Files
allwpilib/wpilibc/BUILD.bazel

81 lines
2.0 KiB
Python

load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
load("//shared/bazel/rules/gen:gen-version-file.bzl", "generate_version_file")
generate_version_file(
name = "generate-version",
output_file = "WPILibVersion.cpp",
template = "src/generate/WPILibVersion.cpp.in",
visibility = ["//wpilibc:__subpackages__"],
)
cc_library(
name = "generated_cc_headers",
hdrs = glob(["src/generated/main/native/include/**"]),
includes = ["src/generated/main/native/include"],
strip_include_prefix = "src/generated/main/native/include",
visibility = ["//wpilibc:__subpackages__"],
)
filegroup(
name = "generated_cc_source",
srcs = glob(
["src/generated/main/native/cpp/**"],
exclude = ["src/generated/main/native/cpp/jni/**"],
),
visibility = ["//wpilibc:__subpackages__"],
)
cc_library(
name = "wpilibc.static",
srcs = [
":generate-version",
] + glob([
"src/main/native/cppcs/**",
"src/main/native/cpp/**",
]) + [":generated_cc_source"],
hdrs = glob(["src/main/native/include/**"]),
strip_include_prefix = "src/main/native/include",
visibility = ["//visibility:public"],
deps = [
":generated_cc_headers",
"//cameraserver:cameraserver.static",
"//cscore:cscore.static",
"//hal:wpiHal.static",
"//ntcore:ntcore.static",
"//wpimath:wpimath.static",
"//wpinet:wpinet.static",
"//wpiutil:wpiutil.static",
],
)
cc_library(
name = "test-headers",
testonly = True,
hdrs = glob(["src/test/native/include/**"]),
includes = ["src/test/native/include"],
)
cc_test(
name = "wpilibc-test",
size = "small",
srcs = glob(["src/test/native/cpp/**"]),
tags = [
"no-asan",
"no-tsan",
"no-ubsan",
],
deps = [
":test-headers",
":wpilibc.static",
"//thirdparty/googletest:googletest.static",
],
)
cc_binary(
name = "DevMain-Cpp",
srcs = ["src/dev/native/cpp/main.cpp"],
deps = [
":wpilibc.static",
],
)