2
0
Fork 0
mirror of https://github.com/bazel-contrib/rules_foreign_cc synced 2024-12-01 22:16:27 +00:00
rules_foreign_cc/examples/cmake_crosstool/BUILD
UebelAndre 08e8c6c93d
Moved example dependencies into loadable bzl files (#467)
* Sorted dependencies

* Added rules_android repository to satisfy buildifier defects

* Added rules_cc repository to satisfy buildifier defects

* Ran Buildifier
2021-01-25 08:04:52 -08:00

31 lines
812 B
Python

load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
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,
lib_source = "//static:srcs",
out_include_dir = "include/version123",
static_libraries = ["libhello.a"],
)
# 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"],
)