From 226af512c2b59921299cf0419c6776b12940b7cf Mon Sep 17 00:00:00 2001 From: wwieclaw Date: Mon, 3 Apr 2023 18:23:16 +0200 Subject: [PATCH] Add check-cmake.BUILD --- third_party/check-cmake.BUILD | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 third_party/check-cmake.BUILD diff --git a/third_party/check-cmake.BUILD b/third_party/check-cmake.BUILD new file mode 100644 index 0000000..6261a83 --- /dev/null +++ b/third_party/check-cmake.BUILD @@ -0,0 +1,32 @@ +# THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, +# EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. + +load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake") + +filegroup( + name = "srcs", + srcs = glob(["**"]), +) + +cmake( + name = "check", + cache_entries = { + "CMAKE_C_FLAGS": "-fPIC", + "CMAKE_INSTALL_LIBDIR": "lib", + "HAVE_SUBUNIT": "0", + }, + lib_source = ":srcs", + linkopts = select({ + "@bazel_tools//src/conditions:darwin": ["-lpthread"], + "//conditions:default": [ + "-lpthread", + "-lrt", + ], + }), + out_static_libs = select({ + "@bazel_tools//src/conditions:windows": ["check.lib"], + "//conditions:default": ["libcheck.a"], + }), + visibility = ["//visibility:public"], +)