2025-11-09 13:32:58 -05:00
|
|
|
# THIS FILE IS AUTO GENERATED
|
|
|
|
|
|
|
|
|
|
load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory")
|
2026-05-15 00:52:39 -04:00
|
|
|
load("//shared/bazel/rules/robotpy:robotpy_rules.bzl", "copy_native_file", "generate_native_files", "robotpy_library")
|
2025-11-09 13:32:58 -05:00
|
|
|
|
|
|
|
|
def define_native_wrapper(name, pyproject_toml = None):
|
2026-05-15 00:52:39 -04:00
|
|
|
pyproject_toml = pyproject_toml or "src/main/python/native-pyproject.toml"
|
|
|
|
|
|
2025-11-09 13:32:58 -05:00
|
|
|
copy_to_directory(
|
|
|
|
|
name = "{}.copy_headers".format(name),
|
|
|
|
|
srcs = native.glob(["src/main/native/include/**"]) + native.glob(["src/generated/main/native/include/**"], allow_empty = True) + native.glob([
|
|
|
|
|
"src/main/native/thirdparty/gcem/include/**",
|
|
|
|
|
"src/main/native/thirdparty/sleipnir/include/**",
|
|
|
|
|
]),
|
|
|
|
|
out = "native/wpimath/include",
|
|
|
|
|
root_paths = ["src/main/native/include/"],
|
|
|
|
|
replace_prefixes = {
|
|
|
|
|
"wpimath/src/generated/main/native/include": "",
|
|
|
|
|
"wpimath/src/main/native/include": "",
|
|
|
|
|
"wpimath/src/main/native/thirdparty/gcem/include": "",
|
|
|
|
|
"wpimath/src/main/native/thirdparty/sleipnir/include": "",
|
|
|
|
|
},
|
|
|
|
|
verbose = False,
|
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
|
)
|
|
|
|
|
|
2026-05-15 00:52:39 -04:00
|
|
|
libinit_files = ["native/wpimath/_init_robotpy_native_wpimath.py"]
|
|
|
|
|
|
|
|
|
|
generate_native_files(
|
2025-11-09 13:32:58 -05:00
|
|
|
name = name,
|
2026-05-15 00:52:39 -04:00
|
|
|
pyproject_toml = pyproject_toml,
|
2025-11-09 13:32:58 -05:00
|
|
|
pc_deps = [
|
|
|
|
|
"//wpiutil:native/wpiutil/robotpy-native-wpiutil.pc",
|
|
|
|
|
],
|
2026-05-15 00:52:39 -04:00
|
|
|
libinit_files = libinit_files,
|
|
|
|
|
pc_files = ["native/wpimath/robotpy-native-wpimath.pc"],
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
copy_native_file(
|
|
|
|
|
name = "wpimath",
|
|
|
|
|
library = "shared/wpimath",
|
|
|
|
|
base_path = "native/wpimath/",
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
robotpy_library(
|
|
|
|
|
name = name,
|
|
|
|
|
distribution = "robotpy-native-wpimath",
|
|
|
|
|
srcs = libinit_files,
|
|
|
|
|
data = [
|
|
|
|
|
name + ".pc_wrapper",
|
|
|
|
|
":wpimath.copy_lib",
|
|
|
|
|
"{}.copy_headers".format(name),
|
|
|
|
|
],
|
2025-11-09 13:32:58 -05:00
|
|
|
deps = [
|
|
|
|
|
"//wpiutil:robotpy-native-wpiutil",
|
|
|
|
|
],
|
2026-03-06 02:18:37 -05:00
|
|
|
summary = "WPILib Math Library",
|
2026-05-15 00:52:39 -04:00
|
|
|
requires = ["robotpy-native-wpiutil==0.0.0"],
|
|
|
|
|
python_requires = ">=3.11",
|
|
|
|
|
strip_path_prefixes = ["wpimath"],
|
2026-03-06 02:18:37 -05:00
|
|
|
entry_points = {
|
|
|
|
|
"pkg_config": [
|
|
|
|
|
"wpimath = native.wpimath",
|
|
|
|
|
],
|
|
|
|
|
},
|
2025-11-09 13:32:58 -05:00
|
|
|
)
|