2021-02-09 20:56:20 +00:00
|
|
|
load("@rules_foreign_cc//tools/build_defs:cmake.bzl", "cmake_external")
|
|
|
|
|
|
|
|
cmake_external(
|
|
|
|
name = "lib_a",
|
|
|
|
lib_source = ":lib_a_sources",
|
2021-02-26 20:21:13 +00:00
|
|
|
static_libraries = select({
|
|
|
|
"//:windows": ["lib_a.lib"],
|
|
|
|
"//conditions:default": ["liblib_a.a"],
|
|
|
|
}),
|
2021-02-09 20:56:20 +00:00
|
|
|
deps = [":lib_b"],
|
|
|
|
)
|
|
|
|
|
|
|
|
cmake_external(
|
|
|
|
name = "lib_b",
|
|
|
|
defines = ["FOO"],
|
|
|
|
lib_source = ":lib_b_sources",
|
2021-02-26 20:21:13 +00:00
|
|
|
static_libraries = select({
|
|
|
|
"//:windows": ["lib_b.lib"],
|
|
|
|
"//conditions:default": ["liblib_b.a"],
|
|
|
|
}),
|
2021-02-09 20:56:20 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
filegroup(
|
|
|
|
name = "lib_a_sources",
|
2021-03-03 18:08:03 +00:00
|
|
|
srcs = ["lib_a/{}".format(s) for s in [
|
|
|
|
"CMakeLists.txt",
|
|
|
|
"lib_a.cpp",
|
|
|
|
]],
|
2021-02-09 20:56:20 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
filegroup(
|
|
|
|
name = "lib_b_sources",
|
2021-03-03 18:08:03 +00:00
|
|
|
srcs = ["lib_b/{}".format(s) for s in [
|
|
|
|
"CMakeLists.txt",
|
|
|
|
"lib_b.cpp",
|
|
|
|
]],
|
2021-02-09 20:56:20 +00:00
|
|
|
)
|