Skip to content

Commit 226af51

Browse files
committed
Add check-cmake.BUILD
1 parent 53cc8fd commit 226af51

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

third_party/check-cmake.BUILD

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
2+
# EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
3+
# WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
4+
5+
load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake")
6+
7+
filegroup(
8+
name = "srcs",
9+
srcs = glob(["**"]),
10+
)
11+
12+
cmake(
13+
name = "check",
14+
cache_entries = {
15+
"CMAKE_C_FLAGS": "-fPIC",
16+
"CMAKE_INSTALL_LIBDIR": "lib",
17+
"HAVE_SUBUNIT": "0",
18+
},
19+
lib_source = ":srcs",
20+
linkopts = select({
21+
"@bazel_tools//src/conditions:darwin": ["-lpthread"],
22+
"//conditions:default": [
23+
"-lpthread",
24+
"-lrt",
25+
],
26+
}),
27+
out_static_libs = select({
28+
"@bazel_tools//src/conditions:windows": ["check.lib"],
29+
"//conditions:default": ["libcheck.a"],
30+
}),
31+
visibility = ["//visibility:public"],
32+
)

0 commit comments

Comments
 (0)