2021-01-25 16:04:52 +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", "cmake")
|
2020-04-24 07:16:21 +00:00
|
|
|
|
|
|
|
filegroup(
|
|
|
|
name = "sources",
|
2021-02-03 20:18:43 +00:00
|
|
|
srcs = glob(["source_root/**"]),
|
2020-04-24 07:16:21 +00:00
|
|
|
)
|
|
|
|
|
2021-03-09 18:55:01 +00:00
|
|
|
cmake(
|
2020-04-24 07:16:21 +00:00
|
|
|
name = "liba",
|
|
|
|
lib_source = ":sources",
|
|
|
|
# This demonstrates the usage of the working directory:
|
|
|
|
# the directory where the "main" CMakeLists.txt file resides.
|
|
|
|
working_directory = "cmake_dir",
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_test(
|
|
|
|
name = "test_lib",
|
|
|
|
srcs = [
|
|
|
|
"test_liba.cpp",
|
|
|
|
],
|
|
|
|
deps = [
|
|
|
|
":liba",
|
|
|
|
],
|
|
|
|
)
|