2
0
Fork 0
mirror of https://github.com/bazel-contrib/rules_foreign_cc synced 2024-12-04 08:02:31 +00:00
rules_foreign_cc/examples/cmake_defines/BUILD
James Sharpe f77a9e12a3
Propagate defines into CFLAGS and CXXFLAGS passed to the framework (#498)
* Propagate defines into CFLAGS and CXXFLAGS passed to the framework

* Fix flags test

* Add example to test propagation of defines
2021-02-09 12:56:20 -08:00

26 lines
580 B
Python

load("@rules_foreign_cc//tools/build_defs:cmake.bzl", "cmake_external")
cmake_external(
name = "lib_a",
lib_source = ":lib_a_sources",
static_libraries = ["liblib_a.a"],
deps = [":lib_b"],
)
cmake_external(
name = "lib_b",
defines = ["FOO"],
lib_source = ":lib_b_sources",
static_libraries = ["liblib_b.a"],
)
filegroup(
name = "lib_a_sources",
srcs = ["lib_a/{}".format(s) for s in ["CMakeLists.txt", "lib_a.cpp"]],
)
filegroup(
name = "lib_b_sources",
srcs = ["lib_b/{}".format(s) for s in ["CMakeLists.txt", "lib_b.cpp"]],
)