2
0
Fork 0
mirror of https://github.com/bazel-contrib/rules_foreign_cc synced 2024-12-03 02:52:58 +00:00
rules_foreign_cc/examples/cmake_defines/BUILD.bazel
2021-07-28 18:12:53 +01:00

40 lines
870 B
Python

load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake")
cmake(
name = "lib_a",
lib_source = ":lib_a_sources",
out_static_libs = select({
"//:windows": ["lib_a.lib"],
"//conditions:default": ["liblib_a.a"],
}),
deps = [":lib_b"],
)
cmake(
name = "lib_b",
defines = ["FOO"],
lib_source = ":lib_b_sources",
out_static_libs = select({
"//:windows": ["lib_b.lib"],
"//conditions:default": ["liblib_b.a"],
}),
)
filegroup(
name = "lib_a_sources",
srcs = ["lib_a/{}".format(s) for s in [
"CMakeLists.txt",
"lib_a.cpp",
]],
visibility = ["//cmake_defines:__subpackages__"],
)
filegroup(
name = "lib_b_sources",
srcs = ["lib_b/{}".format(s) for s in [
"CMakeLists.txt",
"lib_b.cpp",
]],
visibility = ["//cmake_defines:__subpackages__"],
)