[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:
PJ Reiniger
2025-05-12 10:24:41 -04:00
committed by GitHub
parent 0a38400734
commit 0e5a6f38d8
13 changed files with 839 additions and 2 deletions

59
sysid/BUILD.bazel Normal file
View 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",
],
)