mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-01 02:41:48 +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:
44
simulation/halsim_ds_socket/BUILD.bazel
Normal file
44
simulation/halsim_ds_socket/BUILD.bazel
Normal file
@@ -0,0 +1,44 @@
|
||||
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
|
||||
|
||||
cc_library(
|
||||
name = "headers",
|
||||
hdrs = glob(["src/main/native/include/**"]),
|
||||
includes = ["src/main/native/include"],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "halsim_ds_socket",
|
||||
srcs = glob(["src/main/native/cpp/**"]),
|
||||
target_compatible_with = select({
|
||||
"@rules_bzlmodrio_toolchains//constraints/is_roborio:roborio": ["@platforms//:incompatible"],
|
||||
"@rules_bzlmodrio_toolchains//constraints/is_systemcore:systemcore": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
":headers",
|
||||
"//hal:wpiHal.static",
|
||||
"//wpinet:wpinet.static",
|
||||
],
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "halsim_ds_socket-test",
|
||||
size = "small",
|
||||
srcs = glob([
|
||||
"src/test/native/**/*.cpp",
|
||||
"src/test/native/**/*.h",
|
||||
]),
|
||||
deps = [
|
||||
"//simulation/halsim_ds_socket",
|
||||
"//thirdparty/googletest:googletest.static",
|
||||
],
|
||||
)
|
||||
|
||||
cc_binary(
|
||||
name = "DevMain-Cpp",
|
||||
srcs = ["src/dev/native/cpp/main.cpp"],
|
||||
deps = [
|
||||
":halsim_ds_socket",
|
||||
],
|
||||
)
|
||||
51
simulation/halsim_gui/BUILD.bazel
Normal file
51
simulation/halsim_gui/BUILD.bazel
Normal file
@@ -0,0 +1,51 @@
|
||||
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
|
||||
|
||||
cc_library(
|
||||
name = "halsim_gui",
|
||||
srcs = glob([
|
||||
"src/main/native/cpp/*",
|
||||
"src/main/native/include/*.h",
|
||||
]),
|
||||
includes = ["src/main/native/include"],
|
||||
tags = [
|
||||
"wpi-cpp-gui",
|
||||
],
|
||||
target_compatible_with = select({
|
||||
"@rules_bzlmodrio_toolchains//constraints/is_roborio:roborio": ["@platforms//:incompatible"],
|
||||
"@rules_bzlmodrio_toolchains//constraints/is_systemcore:systemcore": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//glass:libglassnt",
|
||||
"//hal:wpiHal.static",
|
||||
],
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "halsim_gui-test",
|
||||
size = "small",
|
||||
srcs = glob([
|
||||
"src/test/native/**/*.cpp",
|
||||
"src/test/native/**/*.h",
|
||||
]),
|
||||
tags = [
|
||||
"no-asan",
|
||||
"wpi-cpp-gui",
|
||||
],
|
||||
deps = [
|
||||
":halsim_gui",
|
||||
"//thirdparty/googletest:googletest.static",
|
||||
],
|
||||
)
|
||||
|
||||
cc_binary(
|
||||
name = "DevMain-Cpp",
|
||||
srcs = ["src/dev/native/cpp/main.cpp"],
|
||||
tags = [
|
||||
"wpi-cpp-gui",
|
||||
],
|
||||
deps = [
|
||||
":halsim_gui",
|
||||
],
|
||||
)
|
||||
27
simulation/halsim_ws_client/BUILD.bazel
Normal file
27
simulation/halsim_ws_client/BUILD.bazel
Normal file
@@ -0,0 +1,27 @@
|
||||
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
|
||||
|
||||
cc_library(
|
||||
name = "halsim_ws_client",
|
||||
srcs = glob([
|
||||
"src/main/native/cpp/*.cpp",
|
||||
"src/main/native/include/*.h",
|
||||
]),
|
||||
includes = ["src/main/native/include"],
|
||||
target_compatible_with = select({
|
||||
"@rules_bzlmodrio_toolchains//constraints/is_roborio:roborio": ["@platforms//:incompatible"],
|
||||
"@rules_bzlmodrio_toolchains//constraints/is_systemcore:systemcore": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//simulation/halsim_ws_core",
|
||||
],
|
||||
)
|
||||
|
||||
cc_binary(
|
||||
name = "DevMain-Cpp",
|
||||
srcs = ["src/dev/native/cpp/main.cpp"],
|
||||
deps = [
|
||||
":halsim_ws_client",
|
||||
],
|
||||
)
|
||||
22
simulation/halsim_ws_core/BUILD.bazel
Normal file
22
simulation/halsim_ws_core/BUILD.bazel
Normal file
@@ -0,0 +1,22 @@
|
||||
load("@rules_cc//cc:defs.bzl", "cc_library")
|
||||
|
||||
cc_library(
|
||||
name = "halsim_ws_core",
|
||||
srcs = glob(["src/main/native/cpp/*.cpp"]),
|
||||
hdrs = glob([
|
||||
"src/main/native/include/*.h",
|
||||
"src/main/native/include/*.inc",
|
||||
]),
|
||||
strip_include_prefix = "src/main/native/include",
|
||||
target_compatible_with = select({
|
||||
"@rules_bzlmodrio_toolchains//constraints/is_roborio:roborio": ["@platforms//:incompatible"],
|
||||
"@rules_bzlmodrio_toolchains//constraints/is_systemcore:systemcore": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//hal:wpiHal.static",
|
||||
"//wpinet:wpinet.static",
|
||||
"//wpiutil:wpiutil.static",
|
||||
],
|
||||
)
|
||||
51
simulation/halsim_ws_server/BUILD.bazel
Normal file
51
simulation/halsim_ws_server/BUILD.bazel
Normal file
@@ -0,0 +1,51 @@
|
||||
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
|
||||
|
||||
cc_library(
|
||||
name = "headers",
|
||||
hdrs = glob(["src/main/native/include/**"]),
|
||||
includes = ["src/main/native/include"],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "halsim_ws_server",
|
||||
srcs = glob(["src/main/native/cpp/**"]),
|
||||
target_compatible_with = select({
|
||||
"@rules_bzlmodrio_toolchains//constraints/is_roborio:roborio": ["@platforms//:incompatible"],
|
||||
"@rules_bzlmodrio_toolchains//constraints/is_systemcore:systemcore": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
":headers",
|
||||
"//simulation/halsim_ws_core",
|
||||
],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "test_headers",
|
||||
srcs = glob(["src/test/native/include/*.h"]),
|
||||
includes = ["src/test/native/include"],
|
||||
strip_include_prefix = "src/test/native/include",
|
||||
)
|
||||
|
||||
cc_test(
|
||||
name = "halsim_ws_server-test",
|
||||
size = "small",
|
||||
srcs = glob(["src/test/native/**/*.cpp"]),
|
||||
tags = [
|
||||
"no-asan",
|
||||
],
|
||||
deps = [
|
||||
":halsim_ws_server",
|
||||
":test_headers",
|
||||
"//thirdparty/googletest:googletest.static",
|
||||
],
|
||||
)
|
||||
|
||||
cc_binary(
|
||||
name = "DevMain-Cpp",
|
||||
srcs = ["src/dev/native/cpp/main.cpp"],
|
||||
deps = [
|
||||
":halsim_ws_server",
|
||||
],
|
||||
)
|
||||
25
simulation/halsim_xrp/BUILD.bazel
Normal file
25
simulation/halsim_xrp/BUILD.bazel
Normal file
@@ -0,0 +1,25 @@
|
||||
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
|
||||
|
||||
cc_library(
|
||||
name = "halsim_xrp",
|
||||
srcs = glob([
|
||||
"src/main/native/cpp/*",
|
||||
"src/main/native/include/*.h",
|
||||
]),
|
||||
includes = ["src/main/native/include"],
|
||||
target_compatible_with = select({
|
||||
"@rules_bzlmodrio_toolchains//constraints/is_roborio:roborio": ["@platforms//:incompatible"],
|
||||
"@rules_bzlmodrio_toolchains//constraints/is_systemcore:systemcore": ["@platforms//:incompatible"],
|
||||
"//conditions:default": [],
|
||||
}),
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//simulation/halsim_ws_core",
|
||||
"//xrpVendordep:xrp-cpp",
|
||||
],
|
||||
)
|
||||
|
||||
cc_binary(
|
||||
name = "DevMain-Cpp",
|
||||
srcs = ["src/dev/native/cpp/main.cpp"],
|
||||
)
|
||||
Reference in New Issue
Block a user