mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-06 03:31:43 +00:00
[bazel] MVP for building GUI related things with bazel (#7934)
Co-authored-by: David Vo <auscompgeek@users.noreply.github.com>
This commit is contained in:
59
sysid/BUILD.bazel
Normal file
59
sysid/BUILD.bazel
Normal file
@@ -0,0 +1,59 @@
|
||||
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
|
||||
load("//shared/bazel/rules/gen:gen-resources.bzl", "generate_resources")
|
||||
load("//shared/bazel/rules/gen:gen-version-file.bzl", "generate_version_file")
|
||||
|
||||
generate_version_file(
|
||||
name = "generate-version",
|
||||
output_file = "WPILibVersion.cpp",
|
||||
template = "src/main/generate/WPILibVersion.cpp.in",
|
||||
visibility = ["//sysid:__subpackages__"],
|
||||
)
|
||||
|
||||
generate_resources(
|
||||
name = "generate-resources",
|
||||
namespace = "sysid",
|
||||
prefix = "SYSID",
|
||||
resource_files = glob(["src/main/native/resources/*"]),
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "sysid-lib",
|
||||
srcs = glob(
|
||||
["src/main/native/cpp/**/*.cpp"],
|
||||
exclude = ["src/main/native/cpp/Main.cpp"],
|
||||
) + [
|
||||
":generate-resources",
|
||||
":generate-version",
|
||||
],
|
||||
hdrs = glob(["src/main/native/include/**"]),
|
||||
strip_include_prefix = "src/main/native/include",
|
||||
visibility = ["//sysid:__subpackages__"],
|
||||
deps = [
|
||||
"//datalog:datalog.static",
|
||||
"//glass:libglass",
|
||||
"//wpinet:wpinet.static",
|
||||
],
|
||||
)
|
||||
|
||||
cc_binary(
|
||||
name = "sysid",
|
||||
srcs = ["src/main/native/cpp/Main.cpp"],
|
||||
linkopts = select({
|
||||
"@bazel_tools//src/conditions:windows": ["-SUBSYSTEM:WINDOWS"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
deps = ["sysid-lib"],
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "sysid-test",
|
||||
size = "medium",
|
||||
srcs = glob(["src/test/native/cpp/**"]),
|
||||
tags = [
|
||||
"no-asan",
|
||||
],
|
||||
deps = [
|
||||
":sysid-lib",
|
||||
"//thirdparty/googletest:googletest.static",
|
||||
],
|
||||
)
|
||||
Reference in New Issue
Block a user