2021-03-01 15:46:25 +00:00
|
|
|
load("@rules_cc//cc:defs.bzl", "cc_test")
|
2021-03-12 16:54:14 +00:00
|
|
|
load("@rules_foreign_cc//foreign_cc:defs.bzl", "ninja")
|
2021-03-01 15:46:25 +00:00
|
|
|
|
|
|
|
ninja(
|
|
|
|
name = "ninja_lib",
|
2021-07-14 16:37:35 +00:00
|
|
|
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",
|
|
|
|
},
|
|
|
|
}),
|
2021-03-01 15:46:25 +00:00
|
|
|
lib_source = "//ninja_simple/code:srcs",
|
2021-03-11 17:14:00 +00:00
|
|
|
out_static_libs = ["liba.a"],
|
2021-03-01 15:46:25 +00:00
|
|
|
targets = [
|
|
|
|
"",
|
|
|
|
"install",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "test_lib",
|
|
|
|
srcs = [
|
|
|
|
"test_libb.cpp",
|
|
|
|
],
|
|
|
|
deps = [
|
|
|
|
":ninja_lib",
|
|
|
|
],
|
|
|
|
)
|