diff --git a/WORKSPACE b/WORKSPACE index 602b2ed4297..f4aa7d147ec 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -98,3 +98,16 @@ setup_legacy_bzlmodrio_opencv_cpp_dependencies() load("@bzlmodrio-opencv//:maven_java_deps.bzl", "setup_legacy_bzlmodrio_opencv_java_dependencies") setup_legacy_bzlmodrio_opencv_java_dependencies() + +http_archive( + name = "build_bazel_apple_support", + sha256 = "c4bb2b7367c484382300aee75be598b92f847896fb31bbd22f3a2346adf66a80", + url = "https://github.com/bazelbuild/apple_support/releases/download/1.15.1/apple_support.1.15.1.tar.gz", +) + +load( + "@build_bazel_apple_support//lib:repositories.bzl", + "apple_support_dependencies", +) + +apple_support_dependencies() diff --git a/apriltag/BUILD.bazel b/apriltag/BUILD.bazel new file mode 100644 index 00000000000..ea1ef1abe00 --- /dev/null +++ b/apriltag/BUILD.bazel @@ -0,0 +1,112 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test") +load("@rules_java//java:defs.bzl", "java_binary", "java_library") +load("@rules_python//python:defs.bzl", "py_binary") +load("//shared/bazel/rules/gen:gen-resources.bzl", "generate_resources") + +cc_library( + name = "thirdparty-apriltag", + srcs = glob(["src/main/native/thirdparty/apriltag/src/**"]), + hdrs = glob(["src/main/native/thirdparty/apriltag/include/**"]), + copts = select({ + "@bazel_tools//src/conditions:darwin": [ + "-Wno-format-nonliteral", + "-Wno-gnu-zero-variadic-macro-arguments", + "-Wno-uninitialized", + "-Wno-sign-compare", + "-Wno-type-limits", + ], + "@bazel_tools//src/conditions:windows": [ + "/wd4005", + "/wd4018", + "/wd4244", + "/wd4267", + "/wd4996", + ], + "@rules_bzlmodrio_toolchains//constraints/combined:is_linux": [ + "-Wno-format-nonliteral", + "-Wno-maybe-uninitialized", + "-Wno-sign-compare", + "-Wno-type-limits", + ], + }), + includes = ["src/main/native/thirdparty/apriltag/include/common"], + strip_include_prefix = "src/main/native/thirdparty/apriltag/include", + visibility = ["//visibility:public"], +) + +generate_resources( + name = "generate-resources", + namespace = "frc", + prefix = "APRILTAG", + resource_files = glob(["src/main/native/resources/**"]), + visibility = ["//visibility:public"], +) + +cc_library( + name = "apriltag.static", + srcs = [":generate-resources"] + glob( + ["src/main/native/cpp/**"], + exclude = ["src/main/native/cpp/jni/**"], + ), + hdrs = glob(["src/main/native/include/**/*"]), + defines = ["WPILIB_EXPORTS"], + strip_include_prefix = "src/main/native/include", + visibility = ["//visibility:public"], + deps = [ + ":thirdparty-apriltag", + "//wpimath:wpimath.static", + "//wpiutil:wpiutil.static", + ], +) + +java_library( + name = "apriltag-java", + srcs = glob(["src/main/java/**/*.java"]), + resource_strip_prefix = "apriltag/src/main/native/resources", + resources = glob(["src/main/native/resources/**"]), + visibility = ["//visibility:public"], + deps = [ + "//wpimath:wpimath-java", + "//wpiutil:wpiutil-java", + "@bzlmodrio-opencv//libraries/java/opencv", + "@maven//:com_fasterxml_jackson_core_jackson_annotations", + "@maven//:com_fasterxml_jackson_core_jackson_core", + "@maven//:com_fasterxml_jackson_core_jackson_databind", + ], +) + +cc_test( + name = "apriltag-cpp-test", + size = "small", + srcs = glob(["src/test/native/cpp/**"]), + tags = [ + "no-asan", + ], + deps = [ + ":apriltag.static", + "//thirdparty/googletest:googletest.static", + ], +) + +cc_binary( + name = "DevMain-Cpp", + srcs = ["src/dev/native/cpp/main.cpp"], + deps = [ + ":apriltag.static", + ], +) + +java_binary( + name = "DevMain-Java", + srcs = ["src/dev/java/edu/wpi/first/apriltag/DevMain.java"], + main_class = "edu.wpi.first.apriltag.DevMain", + deps = [ + ":apriltag-java", + ], +) + +py_binary( + name = "convert_apriltag_layouts", + srcs = ["convert_apriltag_layouts.py"], + tags = ["manual"], +) diff --git a/cameraserver/BUILD.bazel b/cameraserver/BUILD.bazel index 542f0f3c961..73995c01353 100644 --- a/cameraserver/BUILD.bazel +++ b/cameraserver/BUILD.bazel @@ -1,6 +1,22 @@ -load("@rules_cc//cc:defs.bzl", "cc_binary") +load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test") load("@rules_java//java:defs.bzl", "java_binary", "java_library") +cc_library( + name = "cameraserver.static", + srcs = glob(["src/main/native/cpp/**"]), + hdrs = glob(["src/main/native/include/**/*"]), + includes = [ + "cpp", + "src/main/native/include", + ], + strip_include_prefix = "src/main/native/include", + visibility = ["//visibility:public"], + deps = [ + "//cscore:cscore.static", + "//ntcore:ntcore.static", + ], +) + java_library( name = "cameraserver-java", srcs = glob(["src/main/java/**/*.java"]), @@ -16,10 +32,21 @@ java_library( ], ) +cc_test( + name = "cameraserver-cpp-test", + size = "small", + srcs = glob(["src/test/native/**"]), + deps = [ + ":cameraserver.static", + "//thirdparty/googletest:googletest.static", + ], +) + cc_binary( name = "DevMain-Cpp", srcs = ["src/dev/native/cpp/main.cpp"], deps = [ + ":cameraserver.static", ], ) diff --git a/cscore/BUILD.bazel b/cscore/BUILD.bazel index a2470f8afe1..d40fb4d2fd9 100644 --- a/cscore/BUILD.bazel +++ b/cscore/BUILD.bazel @@ -1,5 +1,76 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test", "objc_library") load("@rules_java//java:defs.bzl", "java_binary", "java_library") +WIN_SRCS = glob([ + "src/main/native/windows/**/*.cpp", + "src/main/native/windows/**/*.h", +]) + +LINUX_SRCS = glob([ + "src/main/native/linux/**/*.cpp", + "src/main/native/linux/**/*.h", +]) + +MAC_SRCS = glob(["src/main/native/osx/**/*.cpp"]) + +filegroup( + name = "native-srcs", + srcs = select({ + "@bazel_tools//src/conditions:darwin": MAC_SRCS, + "@bazel_tools//src/conditions:windows": WIN_SRCS, + "@rules_bzlmodrio_toolchains//constraints/combined:is_linux": LINUX_SRCS, + }), +) + +objc_library( + name = "cscore-mac", + srcs = glob([ + "src/main/native/objcpp/**/*.mm", + "src/main/native/cpp/*.h", + ]), + hdrs = glob([ + "src/main/native/include/**/*", + "src/main/native/objcpp/**/*.h", + ]), + copts = [ + "-std=c++20", + ], + includes = [ + "src/main/native/cpp", + "src/main/native/include", + "src/main/native/objcpp", + ], + tags = ["manual"], + deps = [ + "//wpinet:wpinet.static", + "//wpiutil:wpiutil.static", + "@bzlmodrio-opencv//libraries/cpp/opencv", + ], +) + +cc_library( + name = "cscore.static", + srcs = [":native-srcs"] + glob( + ["src/main/native/cpp/**"], + exclude = ["src/main/native/cpp/jni/**"], + ), + hdrs = glob(["src/main/native/include/**/*"]), + includes = [ + "src/main/native/cpp", + "src/main/native/include", + ], + strip_include_prefix = "src/main/native/include", + visibility = ["//visibility:public"], + deps = [ + "//wpinet:wpinet.static", + "//wpiutil:wpiutil.static", + "@bzlmodrio-opencv//libraries/cpp/opencv", + ] + select({ + "@bazel_tools//src/conditions:darwin": [":cscore-mac"], + "//conditions:default": [], + }), +) + java_library( name = "cscore-java", srcs = glob(["src/main/java/**/*.java"]), @@ -10,6 +81,24 @@ java_library( ], ) +cc_test( + name = "cscore-cpp-test", + size = "small", + srcs = glob(["src/test/native/**"]), + deps = [ + ":cscore.static", + "//thirdparty/googletest:googletest.static", + ], +) + +cc_binary( + name = "DevMain-Cpp", + srcs = ["src/dev/native/cpp/main.cpp"], + deps = [ + ":cscore.static", + ], +) + java_binary( name = "DevMain-Java", srcs = ["src/dev/java/edu/wpi/first/cscore/DevMain.java"], diff --git a/epilogue-processor/BUILD.bazel b/epilogue-processor/BUILD.bazel new file mode 100644 index 00000000000..a9a8e083ab4 --- /dev/null +++ b/epilogue-processor/BUILD.bazel @@ -0,0 +1,22 @@ +load("@rules_java//java:defs.bzl", "java_library", "java_plugin") + +java_library( + name = "processor", + srcs = glob(["src/main/java/**/*.java"]), + visibility = ["//visibility:public"], + runtime_deps = [ + "//wpilibNewCommands:wpilibNewCommands-java", + ], + deps = [ + "//epilogue-runtime:epilogue", + ], +) + +java_plugin( + name = "plugin", + processor_class = "edu.wpi.first.epilogue.processor.AnnotationProcessor", + visibility = ["//visibility:public"], + deps = [ + ":processor", + ], +) diff --git a/epilogue-runtime/BUILD.bazel b/epilogue-runtime/BUILD.bazel new file mode 100644 index 00000000000..05db6b75270 --- /dev/null +++ b/epilogue-runtime/BUILD.bazel @@ -0,0 +1,12 @@ +load("@rules_java//java:defs.bzl", "java_library") + +java_library( + name = "epilogue", + srcs = glob(["src/main/java/**/*.java"]), + visibility = ["//visibility:public"], + deps = [ + "//ntcore:networktables-java", + "//wpiunits", + "//wpiutil:wpiutil-java", + ], +) diff --git a/fieldImages/BUILD.bazel b/fieldImages/BUILD.bazel new file mode 100644 index 00000000000..b5cfc82cfa4 --- /dev/null +++ b/fieldImages/BUILD.bazel @@ -0,0 +1,31 @@ +load("@rules_cc//cc:defs.bzl", "cc_library") +load("@rules_java//java:defs.bzl", "java_library") +load("//shared/bazel/rules/gen:gen-resources.bzl", "generate_resources") + +generate_resources( + name = "generate-resources", + namespace = "fields", + prefix = "FIELDS", + resource_files = glob(["src/main/native/resources/**"]), + visibility = ["//visibility:public"], +) + +cc_library( + name = "fieldImages", + srcs = [":generate-resources"] + glob(["src/main/native/cpp/**"]), + hdrs = glob(["src/main/native/include/**/*"]), + strip_include_prefix = "src/main/native/include", + visibility = ["//visibility:public"], +) + +java_library( + name = "fieldImages-java", + srcs = glob(["src/main/java/**/*.java"]), + resource_strip_prefix = "fieldImages/src/main/native/resources", + resources = glob(["src/main/native/resources/**"]), + visibility = ["//visibility:public"], + deps = [ + "@maven//:com_fasterxml_jackson_core_jackson_annotations", + "@maven//:com_fasterxml_jackson_core_jackson_databind", + ], +) diff --git a/romiVendordep/BUILD.bazel b/romiVendordep/BUILD.bazel new file mode 100644 index 00000000000..7cc0913b6e7 --- /dev/null +++ b/romiVendordep/BUILD.bazel @@ -0,0 +1,53 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test") +load("@rules_java//java:defs.bzl", "java_binary", "java_library") + +cc_library( + name = "romi-cpp.static", + srcs = glob([ + "src/main/native/cpp/**", + ]), + hdrs = glob(["src/main/native/include/**"]), + strip_include_prefix = "src/main/native/include", + visibility = ["//visibility:public"], + deps = [ + "//wpilibc:wpilibc.static", + ], +) + +java_library( + name = "romi-java", + srcs = glob(["src/main/java/**/*.java"]), + visibility = ["//visibility:public"], + deps = [ + "//hal:hal-java", + "//wpilibj", + ], +) + +cc_test( + name = "romi-test", + size = "small", + srcs = glob(["src/test/native/cpp/**"]), + deps = [ + "//thirdparty/googletest:googletest.static", + ], +) + +cc_binary( + name = "DevMain-Cpp", + srcs = ["src/dev/native/cpp/main.cpp"], + deps = [ + ":romi-cpp.static", + ], +) + +java_binary( + name = "DevMain-Java", + srcs = ["src/dev/java/edu/wpi/first/wpilibj/romi/DevMain.java"], + main_class = "edu.wpi.first.wpilibj.romi.DevMain", + deps = [ + "//hal:hal-java", + "//ntcore:networktables-java", + "//wpiutil:wpiutil-java", + ], +) diff --git a/shared/bazel/compiler_flags/osx_flags.rc b/shared/bazel/compiler_flags/osx_flags.rc index da12307993e..2aa48df2804 100644 --- a/shared/bazel/compiler_flags/osx_flags.rc +++ b/shared/bazel/compiler_flags/osx_flags.rc @@ -42,3 +42,6 @@ build:macos --linkopt=-Wl,-rpath,'@loader_path'" # Things not in nativetools build:macos --copt=-Wno-shorten-64-to-32 + +build:macos --host_per_file_copt=external/zlib/.*\.c@-Wno-deprecated-non-prototype +build:macos --host_per_file_copt=external/com_google_protobuf/.*\.cc@-Wno-unused-function diff --git a/shared/bazel/compiler_flags/roborio_flags.rc b/shared/bazel/compiler_flags/roborio_flags.rc index 691da8d5e6e..a0a50557263 100644 --- a/shared/bazel/compiler_flags/roborio_flags.rc +++ b/shared/bazel/compiler_flags/roborio_flags.rc @@ -14,3 +14,5 @@ build:roborio --cxxopt=-Wno-error=deprecated-declarations # Extra 11 build:roborio --cxxopt=-Wno-error=deprecated-enum-enum-conversion + +build:roborio --host_per_file_copt=external/zlib/.*\.c@-Wno-deprecated-non-prototype diff --git a/wpilibNewCommands/BUILD.bazel b/wpilibNewCommands/BUILD.bazel new file mode 100644 index 00000000000..6add11137ad --- /dev/null +++ b/wpilibNewCommands/BUILD.bazel @@ -0,0 +1,87 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test") +load("@rules_java//java:defs.bzl", "java_binary", "java_library") + +cc_library( + name = "generated_cc_headers", + hdrs = glob(["src/generated/main/native/include/**"]), + includes = ["src/generated/main/native/include"], + strip_include_prefix = "src/generated/main/native/include", + visibility = ["//wpilibNewCommands:__subpackages__"], +) + +filegroup( + name = "generated_cc_source", + srcs = glob(["src/generated/main/native/cpp/**"]), + visibility = ["//wpilibNewCommands:__subpackages__"], +) + +filegroup( + name = "generated_java", + srcs = glob(["src/generated/main/java/**/*.java"]), + visibility = ["//wpilibNewCommands:__subpackages__"], +) + +cc_library( + name = "wpilibNewCommands.static", + srcs = glob(["src/main/native/cpp/**"]) + [":generated_cc_source"], + hdrs = glob(["src/main/native/include/**"]), + includes = ["src/main/native/include"], + strip_include_prefix = "src/main/native/include", + visibility = ["//visibility:public"], + deps = [ + ":generated_cc_headers", + "//wpilibc:wpilibc.static", + ], +) + +java_library( + name = "wpilibNewCommands-java", + srcs = glob(["src/main/java/**/*.java"]) + [":generated_java"], + visibility = ["//visibility:public"], + deps = [ + "//cscore:cscore-java", + "//hal:hal-java", + "//ntcore:networktables-java", + "//wpilibj", + "//wpimath:wpimath-java", + "//wpinet:wpinet-java", + "//wpiunits", + "//wpiutil:wpiutil-java", + ], +) + +cc_test( + name = "wpilibNewCommands-cpp-test", + size = "small", + srcs = glob([ + "src/test/native/**/*.cpp", + "src/test/native/**/*.h", + ]), + tags = [ + "no-tsan", + "no-ubsan", + ], + deps = [ + ":wpilibNewCommands.static", + "//thirdparty/googletest:googletest.static", + ], +) + +cc_binary( + name = "DevMain-Cpp", + srcs = ["src/dev/native/cpp/main.cpp"], + deps = [ + ], +) + +java_binary( + name = "DevMain-Java", + srcs = ["src/dev/java/edu/wpi/first/wpilibj2/commands/DevMain.java"], + main_class = "edu.wpi.first.wpilibj2.commands.DevMain", + deps = [ + "//hal:hal-java", + "//ntcore:networktables-java", + "//wpimath:wpimath-java", + "//wpiutil:wpiutil-java", + ], +) diff --git a/wpilibc/BUILD.bazel b/wpilibc/BUILD.bazel new file mode 100644 index 00000000000..c11298d3d57 --- /dev/null +++ b/wpilibc/BUILD.bazel @@ -0,0 +1,80 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test") +load("//shared/bazel/rules/gen:gen-version-file.bzl", "generate_version_file") + +generate_version_file( + name = "generate-version", + output_file = "WPILibVersion.cpp", + template = "src/generate/WPILibVersion.cpp.in", + visibility = ["//wpilibc:__subpackages__"], +) + +cc_library( + name = "generated_cc_headers", + hdrs = glob(["src/generated/main/native/include/**"]), + includes = ["src/generated/main/native/include"], + strip_include_prefix = "src/generated/main/native/include", + visibility = ["//wpilibc:__subpackages__"], +) + +filegroup( + name = "generated_cc_source", + srcs = glob( + ["src/generated/main/native/cpp/**"], + exclude = ["src/generated/main/native/cpp/jni/**"], + ), + visibility = ["//wpilibc:__subpackages__"], +) + +cc_library( + name = "wpilibc.static", + srcs = [ + ":generate-version", + ] + glob([ + "src/main/native/cppcs/**", + "src/main/native/cpp/**", + ]) + [":generated_cc_source"], + hdrs = glob(["src/main/native/include/**"]), + strip_include_prefix = "src/main/native/include", + visibility = ["//visibility:public"], + deps = [ + ":generated_cc_headers", + "//cameraserver:cameraserver.static", + "//cscore:cscore.static", + "//hal:wpiHal.static", + "//ntcore:ntcore.static", + "//wpimath:wpimath.static", + "//wpinet:wpinet.static", + "//wpiutil:wpiutil.static", + ], +) + +cc_library( + name = "test-headers", + testonly = True, + hdrs = glob(["src/test/native/include/**"]), + includes = ["src/test/native/include"], +) + +cc_test( + name = "wpilibc-test", + size = "small", + srcs = glob(["src/test/native/cpp/**"]), + tags = [ + "no-asan", + "no-tsan", + "no-ubsan", + ], + deps = [ + ":test-headers", + ":wpilibc.static", + "//thirdparty/googletest:googletest.static", + ], +) + +cc_binary( + name = "DevMain-Cpp", + srcs = ["src/dev/native/cpp/main.cpp"], + deps = [ + ":wpilibc.static", + ], +) diff --git a/wpilibcIntegrationTests/BUILD.bazel b/wpilibcIntegrationTests/BUILD.bazel new file mode 100644 index 00000000000..c67b2dd969b --- /dev/null +++ b/wpilibcIntegrationTests/BUILD.bazel @@ -0,0 +1,24 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") + +ATHENA_SOURCES = glob(["src/main/native/cpp/**"]) + +NON_ATHENA_SOURCES = glob(["src/main/native/dt/**"]) + +cc_library( + name = "test_headers", + hdrs = glob(["src/main/native/include/**"]), + strip_include_prefix = "src/main/native/include", +) + +cc_binary( + name = "wpilibcIntegrationTests", + srcs = select({ + "@rules_bzlmodrio_toolchains//constraints/is_roborio:roborio": ATHENA_SOURCES, + "//conditions:default": NON_ATHENA_SOURCES, + }), + deps = [ + ":test_headers", + "//thirdparty/googletest:googletest.static", + "//wpilibc:wpilibc.static", + ], +) diff --git a/wpimath/BUILD.bazel b/wpimath/BUILD.bazel index 2f650293fdb..7979a8ba1cb 100644 --- a/wpimath/BUILD.bazel +++ b/wpimath/BUILD.bazel @@ -1,3 +1,4 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test") load("@rules_java//java:defs.bzl", "java_binary", "java_library") load("@rules_python//python:defs.bzl", "py_binary") @@ -7,6 +8,76 @@ filegroup( visibility = ["//wpimath:__subpackages__"], ) +cc_library( + name = "eigen-headers", + hdrs = glob([ + "src/main/native/thirdparty/eigen/include/**", + ]), + includes = ["src/main/native/thirdparty/eigen/include"], + strip_include_prefix = "src/main/native/thirdparty/eigen/include", + visibility = ["//wpimath:__subpackages__"], +) + +cc_library( + name = "gcem", + hdrs = glob([ + "src/main/native/thirdparty/gcem/include/**", + ]), + includes = ["src/main/native/thirdparty/gcem/include"], + strip_include_prefix = "src/main/native/thirdparty/gcem/include", + visibility = ["//wpimath:__subpackages__"], +) + +cc_library( + name = "sleipnir-headers", + hdrs = glob([ + "src/main/native/thirdparty/sleipnir/include/**/*.hpp", + ]), + includes = ["src/main/native/thirdparty/sleipnir/include"], + strip_include_prefix = "src/main/native/thirdparty/sleipnir/include", + visibility = ["//wpimath:__subpackages__"], +) + +filegroup( + name = "sleipnir-srcs", + srcs = glob(["src/main/native/thirdparty/sleipnir/src/**"]), + visibility = ["//wpimath:__subpackages__"], +) + +cc_library( + name = "nanopb-generated-headers", + hdrs = glob(["src/generated/main/native/cpp/**/*.h"]), + includes = ["src/generated/main/native/cpp"], + strip_include_prefix = "src/generated/main/native/cpp", + visibility = ["//wpiutil:__subpackages__"], +) + +cc_library( + name = "wpimath.static", + srcs = glob( + [ + "src/main/native/cpp/**", + "src/generated/main/native/cpp/**/*.cpp", + ], + exclude = ["src/main/native/cpp/jni/**"], + ) + [":sleipnir-srcs"], + hdrs = glob(["src/main/native/include/**"]), + defines = ["WPILIB_EXPORTS"], + includes = [ + "src/main/native/include", + "src/main/native/thirdparty/sleipnir/src", + ], + strip_include_prefix = "src/main/native/include", + visibility = ["//visibility:public"], + deps = [ + ":eigen-headers", + ":gcem", + ":nanopb-generated-headers", + ":sleipnir-headers", + "//wpiutil:wpiutil.static", + ], +) + java_library( name = "wpimath-java", srcs = [":generated_java"] + glob(["src/main/java/**/*.java"]), @@ -24,6 +95,40 @@ java_library( ], ) +cc_library( + name = "test_headers", + hdrs = glob([ + "src/test/native/include/**", + ]), + strip_include_prefix = "src/test/native/include", +) + +cc_test( + name = "wpimath-cpp-test", + size = "small", + srcs = glob([ + "src/test/native/cpp/**/*.cpp", + "src/test/native/cpp/**/*.h", + ]), + tags = [ + "no-bullseye", + "no-raspi", + ], + deps = [ + ":test_headers", + ":wpimath.static", + "//thirdparty/googletest:googletest.static", + ], +) + +cc_binary( + name = "DevMain-Cpp", + srcs = ["src/dev/native/cpp/main.cpp"], + deps = [ + ":wpimath.static", + ], +) + java_binary( name = "DevMain-Java", srcs = ["src/dev/java/edu/wpi/first/math/DevMain.java"], diff --git a/wpiutil/BUILD.bazel b/wpiutil/BUILD.bazel index 6e9318bedff..928fa4e8f3d 100644 --- a/wpiutil/BUILD.bazel +++ b/wpiutil/BUILD.bazel @@ -197,9 +197,9 @@ cc_library( ":llvm-srcs", ":memory-srcs", ":mpack-srcs", + ":nanopb-srcs", ":native-srcs", ":protobuf-srcs", - ":nanopb-srcs", ], hdrs = glob(["src/main/native/include/**/*"]), includes = ["src/main/native/include"], @@ -215,8 +215,8 @@ cc_library( ":llvm-headers", ":memory-headers", ":mpack-headers", - ":protobuf-headers", ":nanopb-headers", + ":protobuf-headers", ":sigslot-headers", ] + select({ "@rules_bzlmodrio_toolchains//constraints/is_roborio:roborio": ["@bzlmodrio-ni//libraries/cpp/ni:shared"], diff --git a/xrpVendordep/BUILD.bazel b/xrpVendordep/BUILD.bazel new file mode 100644 index 00000000000..964ea19d70f --- /dev/null +++ b/xrpVendordep/BUILD.bazel @@ -0,0 +1,54 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test") +load("@rules_java//java:defs.bzl", "java_binary", "java_library") + +cc_library( + name = "xrp-cpp", + srcs = glob([ + "src/main/native/cpp/**", + ]), + hdrs = glob(["src/main/native/include/**"]), + strip_include_prefix = "src/main/native/include", + visibility = ["//visibility:public"], + deps = [ + "//wpilibc:wpilibc.static", + ], +) + +java_library( + name = "xrp-java", + srcs = glob(["src/main/java/**/*.java"]), + visibility = ["//visibility:public"], + deps = [ + "//hal:hal-java", + "//wpilibj", + "//wpimath:wpimath-java", + ], +) + +cc_test( + name = "xrp-cpp-test", + size = "small", + srcs = glob(["src/test/native/cpp/**"]), + deps = [ + "//thirdparty/googletest:googletest.static", + ], +) + +cc_binary( + name = "DevMain-Cpp", + srcs = ["src/dev/native/cpp/main.cpp"], + deps = [ + "//wpiutil:wpiutil.static", + ], +) + +java_binary( + name = "DevMain-Java", + srcs = ["src/dev/java/edu/wpi/first/wpilibj/xrp/DevMain.java"], + main_class = "edu.wpi.first.wpilibj.xrp.DevMain", + deps = [ + "//hal:hal-java", + "//ntcore:networktables-java", + "//wpiutil:wpiutil-java", + ], +)