mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
149 lines
3.9 KiB
Python
149 lines
3.9 KiB
Python
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_test")
|
|
load("//shared/bazel/rules:cc_rules.bzl", "wpilib_cc_library", "wpilib_cc_shared_library", "wpilib_cc_static_library")
|
|
load("//shared/bazel/rules:packaging.bzl", "package_minimal_cc_project")
|
|
|
|
wpilib_cc_library(
|
|
name = "halsim_gui",
|
|
srcs = glob([
|
|
"src/main/native/cpp/*",
|
|
"src/main/native/include/**/*.hpp",
|
|
]),
|
|
include_license_files = True,
|
|
includes = ["src/main/native/include"],
|
|
linkopts = [
|
|
"-lm",
|
|
],
|
|
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:glassnt",
|
|
"//hal:wpiHal",
|
|
],
|
|
)
|
|
|
|
wpilib_cc_library(
|
|
name = "halsim_gui_static",
|
|
srcs = glob([
|
|
"src/main/native/cpp/*",
|
|
"src/main/native/include/**/*.hpp",
|
|
]),
|
|
copts = [
|
|
"-DHALSIM_InitExtension=HALSIM_InitExtension_GUI",
|
|
],
|
|
include_license_files = True,
|
|
includes = ["src/main/native/include"],
|
|
linkopts = [
|
|
"-lm",
|
|
],
|
|
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:glassnt",
|
|
"//hal:wpiHal",
|
|
],
|
|
)
|
|
|
|
wpilib_cc_shared_library(
|
|
name = "shared/halsim_gui",
|
|
additional_linker_inputs = select({
|
|
"@platforms//os:osx": [
|
|
"//thirdparty/imgui_suite:glfw_src_darwin",
|
|
"//thirdparty/imgui_suite:imgui_src_darwin",
|
|
"//wpigui:wpigui-mac",
|
|
],
|
|
"//conditions:default": [],
|
|
}),
|
|
dynamic_deps = [
|
|
"//hal:shared/wpiHal",
|
|
"//wpimath:shared/wpimath",
|
|
"//datalog:shared/datalog",
|
|
"//ntcore:shared/ntcore",
|
|
],
|
|
user_link_flags = select({
|
|
"@platforms//os:osx": [
|
|
"-Wl,-force_load,$(location //thirdparty/imgui_suite:glfw_src_darwin)",
|
|
"-Wl,-force_load,$(location //thirdparty/imgui_suite:imgui_src_darwin)",
|
|
"-Wl,-force_load,$(location //wpigui:wpigui-mac)",
|
|
"-framework",
|
|
"Metal",
|
|
"-framework",
|
|
"MetalKit",
|
|
"-framework",
|
|
"Cocoa",
|
|
"-framework",
|
|
"IOKit",
|
|
"-framework",
|
|
"CoreFoundation",
|
|
"-framework",
|
|
"CoreVideo",
|
|
"-framework",
|
|
"QuartzCore",
|
|
],
|
|
"//conditions:default": [],
|
|
}),
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":halsim_gui",
|
|
],
|
|
)
|
|
|
|
wpilib_cc_static_library(
|
|
name = "static/halsim_gui",
|
|
static_deps = [
|
|
"//hal:static/wpiHal",
|
|
"//wpimath:static/wpimath",
|
|
"//datalog:static/datalog",
|
|
"//ntcore:static/ntcore",
|
|
"//glass:static/glassnt",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":halsim_gui_static",
|
|
],
|
|
)
|
|
|
|
cc_test(
|
|
name = "halsim_gui-test",
|
|
size = "small",
|
|
srcs = glob(["src/test/native/**/*.cpp"]),
|
|
tags = [
|
|
"no-asan",
|
|
"wpi-cpp-gui",
|
|
],
|
|
deps = [
|
|
":halsim_gui",
|
|
"//thirdparty/googletest",
|
|
],
|
|
)
|
|
|
|
cc_binary(
|
|
name = "DevMain-Cpp",
|
|
srcs = ["src/dev/native/cpp/main.cpp"],
|
|
tags = [
|
|
"wpi-cpp-gui",
|
|
],
|
|
deps = [
|
|
":halsim_gui",
|
|
],
|
|
)
|
|
|
|
package_minimal_cc_project(
|
|
name = "halsim_gui",
|
|
maven_artifact_name = "halsim_gui",
|
|
maven_group_id = "edu.wpi.first.halsim",
|
|
)
|