mirror of
https://github.com/bazel-contrib/rules_foreign_cc
synced 2024-11-28 08:43:26 +00:00
32e222aeff
* 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
34 lines
781 B
Python
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",
|
|
],
|
|
)
|