cc_library( name = "version", srcs = ["cxx_version.cc"], hdrs = ["version.h"], linkopts = ["-ldl"], visibility = ["//tests/legacy/examples/cgo:__pkg__"], # TODO(yugui) Support darwin too and remove this workaround. # See also comments in cxx_version.cc. deps = select({ "@platforms//os:macos": [], "//conditions:default": [":c_version_import"], }), ) cc_binary( name = "c_version_so", srcs = [ "c_version.c", "c_version.h", ], linkshared = True, ) cc_import( name = "c_version_import", hdrs = ["c_version.h"], shared_library = ":c_version_so", tags = ["manual"], )