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/ninja_simple/BUILD.bazel
UebelAndre 32e222aeff
Enable more examples tests on windows (#718)
* Enable examples tests on windows

* Fixed windows absolute paths being treated as relative.

* Escape windows backslashes for sed replacement

* Improve `//cmake_hello_world_lib/static:libhello` example
2021-07-14 09:37:35 -07:00

34 lines
781 B
Python

load("@rules_cc//cc:defs.bzl", "cc_test")
load("@rules_foreign_cc//foreign_cc:defs.bzl", "ninja")
ninja(
name = "ninja_lib",
build_data = ["//ninja_simple/code:clang_wrapper.sh"],
env = select({
"//:windows": {
"CLANG_WRAPPER": "$(execpath //ninja_simple/code:clang_wrapper.sh)",
"CXX_FLAGS": "/MD",
},
"//conditions:default": {
"CLANG_WRAPPER": "$(execpath //ninja_simple/code:clang_wrapper.sh)",
"CXX_FLAGS": "-fPIC",
},
}),
lib_source = "//ninja_simple/code:srcs",
out_static_libs = ["liba.a"],
targets = [
"",
"install",
],
)
cc_test(
name = "test_lib",
srcs = [
"test_libb.cpp",
],
deps = [
":ninja_lib",
],
)