mirror of
https://github.com/bazel-contrib/rules_foreign_cc
synced 2024-11-30 16:42:07 +00:00
35 lines
844 B
Python
35 lines
844 B
Python
load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake")
|
|
|
|
filegroup(
|
|
name = "srcs",
|
|
srcs = glob(["src/**"]),
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
# Building all targets with the `srcs` CMake project will fail.
|
|
# this example demonstrates how users can avoid unnecessary targets
|
|
cmake(
|
|
name = "cmake_with_target",
|
|
build_args = [
|
|
"--verbose",
|
|
"--", # <- Pass remaining options to the native tool.
|
|
"-j 1",
|
|
],
|
|
install_args = ["--component working"],
|
|
lib_source = ":srcs",
|
|
out_static_libs = select({
|
|
"@platforms//os:windows": [
|
|
"working_a.lib",
|
|
"working_b.lib",
|
|
],
|
|
"//conditions:default": [
|
|
"libworking_a.a",
|
|
"libworking_b.a",
|
|
],
|
|
}),
|
|
targets = [
|
|
"working_a",
|
|
"working_b",
|
|
],
|
|
)
|