2021-01-25 16:04:52 +00:00
|
|
|
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
|
2018-12-06 17:14:00 +00:00
|
|
|
load("@rules_foreign_cc//tools/build_defs:cmake.bzl", "cmake_external")
|
|
|
|
|
|
|
|
filegroup(
|
|
|
|
name = "srcs",
|
|
|
|
srcs = glob(["**"]),
|
|
|
|
visibility = ["//src/test/shell/bazel/testdata:__pkg__"],
|
|
|
|
)
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
name = "hello",
|
|
|
|
srcs = ["hello.cc"],
|
|
|
|
)
|
|
|
|
|
|
|
|
cmake_external(
|
|
|
|
name = "hello_cmake",
|
|
|
|
generate_crosstool_file = True,
|
2020-05-04 17:50:45 +00:00
|
|
|
lib_source = "//static:srcs",
|
2018-12-06 17:14:00 +00:00
|
|
|
out_include_dir = "include/version123",
|
2020-05-04 17:50:45 +00:00
|
|
|
static_libraries = ["libhello.a"],
|
2018-12-06 17:14:00 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# I do not make it a test, since it is a cross-compilation example,
|
|
|
|
# requires test that just checks something about output
|
|
|
|
cc_binary(
|
|
|
|
name = "libhello_test",
|
|
|
|
# includes just hello.h, include directory: "include/version123"
|
|
|
|
srcs = ["//static:hello_client.c"],
|
|
|
|
deps = [":hello_cmake"],
|
|
|
|
)
|