2025-05-12 10:24:41 -04:00
|
|
|
load("@rules_cc//cc:defs.bzl", "cc_library")
|
2025-06-27 19:36:12 -04:00
|
|
|
load("@rules_pkg//:mappings.bzl", "pkg_files")
|
|
|
|
|
load("//shared/bazel/rules:cc_rules.bzl", "wpilib_cc_library", "wpilib_cc_static_library")
|
2025-05-12 10:24:41 -04:00
|
|
|
load("//shared/bazel/rules:objectivec_rules.bzl", "wpilib_objc_library")
|
2025-11-10 09:10:49 -08:00
|
|
|
load("//shared/bazel/rules:packaging.bzl", "package_static_cc_project")
|
|
|
|
|
load("//shared/bazel/rules:publishing.bzl", "host_architectures")
|
2025-05-12 10:24:41 -04:00
|
|
|
|
|
|
|
|
WIN_SRCS = glob(["src/main/native/directx11/**/*.cpp"])
|
|
|
|
|
|
|
|
|
|
LINUX_SRCS = glob(["src/main/native/opengl3/**/*.cpp"])
|
|
|
|
|
|
|
|
|
|
MAC_SRCS = glob(["src/main/native/metal/**/*.mm"])
|
|
|
|
|
|
|
|
|
|
cc_library(
|
|
|
|
|
name = "headers",
|
|
|
|
|
hdrs = glob(["src/main/native/include/**/*"]),
|
|
|
|
|
strip_include_prefix = "src/main/native/include",
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
wpilib_objc_library(
|
|
|
|
|
name = "wpigui-mac",
|
|
|
|
|
srcs = MAC_SRCS,
|
|
|
|
|
sdk_frameworks = [
|
|
|
|
|
"Metal",
|
|
|
|
|
"MetalKit",
|
|
|
|
|
"Cocoa",
|
|
|
|
|
"IOKit",
|
|
|
|
|
"CoreFoundation",
|
|
|
|
|
"CoreVideo",
|
|
|
|
|
"QuartzCore",
|
|
|
|
|
],
|
2025-07-31 21:04:22 -07:00
|
|
|
visibility = ["//visibility:public"],
|
2025-05-12 10:24:41 -04:00
|
|
|
deps = [
|
|
|
|
|
":headers",
|
|
|
|
|
"//thirdparty/imgui_suite",
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
|
2025-06-27 19:36:12 -04:00
|
|
|
pkg_files(
|
|
|
|
|
name = "native-pkg",
|
|
|
|
|
srcs = glob([
|
|
|
|
|
"src/main/native/directx11/**",
|
|
|
|
|
"src/main/native/opengl3/**",
|
|
|
|
|
"src/main/native/metal/**",
|
|
|
|
|
]),
|
|
|
|
|
)
|
|
|
|
|
|
2025-06-13 23:53:09 -04:00
|
|
|
wpilib_cc_library(
|
2025-05-12 10:24:41 -04:00
|
|
|
name = "wpigui",
|
|
|
|
|
srcs = glob(["src/main/native/cpp/**/*.cpp"]) +
|
|
|
|
|
select({
|
2025-07-31 21:04:22 -07:00
|
|
|
"@platforms//os:osx": [],
|
|
|
|
|
"@platforms//os:windows": WIN_SRCS,
|
2025-05-12 10:24:41 -04:00
|
|
|
"@rules_bzlmodrio_toolchains//constraints/combined:is_linux": LINUX_SRCS,
|
|
|
|
|
}),
|
2025-06-27 19:36:12 -04:00
|
|
|
extra_src_pkg_files = [":native-pkg"],
|
|
|
|
|
include_license_files = True,
|
2025-05-12 10:24:41 -04:00
|
|
|
strip_include_prefix = "include",
|
|
|
|
|
tags = [
|
|
|
|
|
"wpi-cpp-gui",
|
|
|
|
|
],
|
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
|
deps = [
|
|
|
|
|
":headers",
|
|
|
|
|
"//thirdparty/imgui_suite",
|
|
|
|
|
] + select({
|
2025-07-31 21:04:22 -07:00
|
|
|
"@platforms//os:osx": [":wpigui-mac"],
|
2025-05-12 10:24:41 -04:00
|
|
|
"//conditions:default": [],
|
|
|
|
|
}),
|
|
|
|
|
)
|
2025-06-27 19:36:12 -04:00
|
|
|
|
|
|
|
|
wpilib_cc_static_library(
|
|
|
|
|
name = "static/wpigui",
|
|
|
|
|
static_deps = [
|
|
|
|
|
"//thirdparty/imgui_suite:static/imguiSuite",
|
|
|
|
|
],
|
|
|
|
|
static_lib_name = select({
|
2025-07-31 21:04:22 -07:00
|
|
|
"@platforms//os:windows": "static/wpigui.lib",
|
2025-06-27 19:36:12 -04:00
|
|
|
"//conditions:default": "static/libwpigui.a",
|
|
|
|
|
}),
|
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
|
deps = [
|
|
|
|
|
":wpigui",
|
|
|
|
|
],
|
|
|
|
|
)
|
2025-07-24 09:11:09 -04:00
|
|
|
|
2025-11-10 09:10:49 -08:00
|
|
|
package_static_cc_project(
|
2025-07-24 09:11:09 -04:00
|
|
|
name = "wpigui",
|
2025-11-10 09:10:49 -08:00
|
|
|
architectures = host_architectures,
|
2025-07-24 09:11:09 -04:00
|
|
|
maven_artifact_name = "wpigui-cpp",
|
2025-11-07 20:00:38 -05:00
|
|
|
maven_group_id = "org.wpilib.wpigui",
|
2025-07-24 09:11:09 -04:00
|
|
|
)
|