1cc_library( 2 name = "version", 3 srcs = ["cxx_version.cc"], 4 hdrs = ["version.h"], 5 linkopts = ["-ldl"], 6 visibility = ["//tests/legacy/examples/cgo:__pkg__"], 7 # TODO(yugui) Support darwin too and remove this workaround. 8 # See also comments in cxx_version.cc. 9 deps = select({ 10 "@platforms//os:macos": [], 11 "//conditions:default": [":c_version_import"], 12 }), 13) 14 15cc_binary( 16 name = "c_version_so", 17 srcs = [ 18 "c_version.c", 19 "c_version.h", 20 ], 21 linkshared = True, 22) 23 24cc_import( 25 name = "c_version_import", 26 hdrs = ["c_version.h"], 27 shared_library = ":c_version_so", 28 tags = ["manual"], 29) 30