Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions apriltag/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,12 @@ generate_resources(
wpilib_cc_library(
name = "apriltag",
srcs = [":generate-resources"] + glob(
["src/main/native/cpp/**"],
["src/main/native/cpp/**/*.cpp"],
exclude = ["src/main/native/cpp/jni/**"],
),
hdrs = glob(["src/main/native/include/**/*"]),
hdrs = glob([
"src/main/native/include/**/*.hpp",
]),
extra_hdr_pkg_files = [":thirdparty-apriltag-src-pkg"],
extra_src_pkg_files = [":apriltag-java-jni-hdrs-pkg"],
local_defines = ["WPILIB_EXPORTS"],
Expand Down
6 changes: 4 additions & 2 deletions cameraserver/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ filegroup(

wpilib_cc_library(
name = "cameraserver",
srcs = glob(["src/main/native/cpp/**"]),
hdrs = glob(["src/main/native/include/**/*"]),
srcs = glob(["src/main/native/cpp/**/*.cpp"]),
hdrs = glob([
"src/main/native/include/**/*.hpp",
]),
includes = [
"cpp",
"src/main/native/include",
Expand Down
6 changes: 4 additions & 2 deletions commandsv2/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ filegroup(

wpilib_cc_library(
name = "commandsv2",
srcs = glob(["src/main/native/cpp/**"]),
hdrs = glob(["src/main/native/include/**"]),
srcs = glob(["src/main/native/cpp/**/*.cpp"]),
hdrs = glob([
"src/main/native/include/**/*.hpp",
]),
includes = ["src/main/native/include"],
strip_include_prefix = "src/main/native/include",
third_party_libraries = [
Expand Down
20 changes: 14 additions & 6 deletions cscore/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,16 @@ wpilib_objc_library(

wpilib_cc_library(
name = "cscore",
srcs = [":native-srcs"] + glob(
["src/main/native/cpp/**"],
srcs = [":native-srcs"] + glob([
"src/main/native/cpp/**/*.cpp",
"src/main/native/cpp/**/*.hpp",
],
exclude = ["src/main/native/cpp/jni/**"],
),
hdrs = glob(["src/main/native/include/**/*"]),
hdrs = glob([
"src/main/native/include/**/*.hpp",
"src/main/native/include/**/*.h",
]),
extra_src_pkg_files = [
":cscore-java-jni-hdrs-pkg",
],
Expand Down Expand Up @@ -259,9 +264,12 @@ java_binary(

[wpilib_cc_library(
name = example + "-examples",
srcs = glob([
"examples/" + example + "/*.cpp",
]),
srcs = glob(
[
"examples/" + example + "/*.cpp",
],
allow_empty = True,
),
tags = [
"wpi-example",
],
Expand Down
7 changes: 5 additions & 2 deletions datalog/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ load("//shared/bazel/rules/robotpy:pytest_util.bzl", "robotpy_py_test")
wpilib_cc_library(
name = "datalog",
srcs = glob(
["src/main/native/cpp/**"],
["src/main/native/cpp/**/*.cpp"],
exclude = ["src/main/native/cpp/jni/**"],
),
hdrs = glob(["src/main/native/include/**"]),
hdrs = glob([
"src/main/native/include/**/*.h",
"src/main/native/include/**/*.hpp",
]),
extra_src_pkg_files = [":datalog-java-jni-hdrs-pkg"],
includes = [
"src/main/native/cpp",
Expand Down
6 changes: 4 additions & 2 deletions fields/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ generate_resources(

wpilib_cc_library(
name = "fields",
srcs = [":generate-resources"] + glob(["src/main/native/cpp/**"]),
hdrs = glob(["src/main/native/include/**/*"]),
srcs = [":generate-resources"] + glob(["src/main/native/cpp/**/*.cpp"]),
hdrs = glob([
"src/main/native/include/**/*.hpp",
]),
include_license_files = True,
strip_include_prefix = "src/main/native/include",
visibility = ["//visibility:public"],
Expand Down
4 changes: 3 additions & 1 deletion glass/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ load("//shared/bazel/rules/gen:gen-version-file.bzl", "generate_version_file")
wpilib_cc_library(
name = "glass",
srcs = glob(["src/lib/native/cpp/**/*.cpp"]),
hdrs = glob(["src/lib/native/include/**"]),
hdrs = glob([
"src/lib/native/include/**/*.hpp",
]),
hdrs_pkg_root = "src/lib/native/include",
include_license_files = True,
srcs_pkg_root = "src/lib/native/cpp",
Expand Down
8 changes: 5 additions & 3 deletions hal/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,14 @@ wpilib_cc_library(
name = "wpiHal",
srcs = [":platform-srcs"] + glob(
[
"src/main/native/cpp/**",
"src/generated/main/native/cpp/**",
"src/main/native/cpp/**/*.cpp",
"src/generated/main/native/cpp/**/*.cpp",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a problem that this doesn't include hal/src/generated/main/native/cpp/mrc/protobuf/MrcComm.npb.h?

],
exclude = ["src/main/native/cpp/jni/**"],
),
hdrs = glob(["src/main/native/include/**/*"]),
hdrs = glob([
"src/main/native/include/**/*.h",
]),
extra_src_pkg_files = [
":hal-sim-pkg",
":hal-systemcore-pkg",
Expand Down
8 changes: 6 additions & 2 deletions ntcore/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,14 @@ cc_library(
wpilib_cc_library(
name = "ntcore",
srcs = glob(
["src/main/native/cpp/**"],
["src/main/native/cpp/**/*.cpp",
"src/main/native/cpp/**/*.hpp"],
Comment on lines +94 to +95
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this formatted?

exclude = ["src/main/native/cpp/jni/**"],
),
hdrs = glob(["src/main/native/include/**/*"]),
hdrs = glob([
"src/main/native/include/**/*.h",
"src/main/native/include/**/*.hpp",
]),
extra_src_pkg_files = [
":ntcore-java-jni-hdrs-pkg",
],
Expand Down
8 changes: 5 additions & 3 deletions ntcoreffi/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ cc_library(
wpilib_cc_library(
name = "ntcoreffi",
srcs = glob([
"src/main/native/c/**",
"src/main/native/cpp/**",
"src/main/native/c/**/*.c",
"src/main/native/cpp/**/*.cpp",
]),
hdrs = glob([
"src/main/native/include/**/*.h",
]),
hdrs = glob(["src/main/native/include/**"]),
extra_hdr_pkg_files = [
"//wpiutil:fmtlib-hdrs-pkg",
"//wpiutil:llvm-hdrs-pkg",
Expand Down
6 changes: 4 additions & 2 deletions romiVendordep/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ filegroup(
wpilib_cc_library(
name = "romiVendordep",
srcs = glob([
"src/main/native/cpp/**",
"src/main/native/cpp/**/*.cpp",
]),
hdrs = glob([
"src/main/native/include/**/*.hpp",
]),
hdrs = glob(["src/main/native/include/**"]),
strip_include_prefix = "src/main/native/include",
visibility = ["//visibility:public"],
deps = [
Expand Down
8 changes: 5 additions & 3 deletions shared/bazel/rules/cc_rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ def third_party_cc_lib_helper(
src_root = None,
src_excludes = [],
defines = [],
visibility = None):
visibility = None,
hdr_exts = ['.h', '.hpp']
):
"""
Helper for src / headers pairs that aren't directly compiled, but rather pulled into a bigger library.

Expand All @@ -210,8 +212,8 @@ def third_party_cc_lib_helper(
cc_library(
name = name + "-headers",
hdrs = native.glob([
include_root + "/**",
]),
include_root + "/**/*" + ext for ext in hdr_exts
], allow_empty = True),
includes = [include_root],
defines = defines,
strip_include_prefix = include_root,
Expand Down
2 changes: 1 addition & 1 deletion simulation/halsim_ds_socket/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ wpilib_cc_library(

wpilib_cc_library(
name = "halsim_ds_socket_static",
srcs = glob(["src/main/native/cpp/**"]),
srcs = glob(["src/main/native/cpp/**/*.cpp"]),
copts = [
"-DHALSIM_InitExtension=HALSIM_InitExtension_DS_SOCKET",
],
Expand Down
8 changes: 5 additions & 3 deletions simulation/halsim_gui/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ load("//shared/bazel/rules:publishing.bzl", "host_architectures")
wpilib_cc_library(
name = "halsim_gui",
srcs = glob([
"src/main/native/cpp/*",
"src/main/native/include/**/*.hpp",
"src/main/native/cpp/*.cpp",
"src/main/native/cpp/*.hpp",
"src/main/native/include/**/*.hpp"
]),
include_license_files = True,
includes = ["src/main/native/include"],
Expand All @@ -32,7 +33,8 @@ wpilib_cc_library(
wpilib_cc_library(
name = "halsim_gui_static",
srcs = glob([
"src/main/native/cpp/*",
"src/main/native/cpp/*.cpp",
"src/main/native/cpp/*.hpp",
"src/main/native/include/**/*.hpp",
]),
copts = [
Expand Down
2 changes: 1 addition & 1 deletion simulation/halsim_ws_server/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ wpilib_cc_library(

wpilib_cc_library(
name = "halsim_ws_server_static",
srcs = glob(["src/main/native/cpp/**"]),
srcs = glob(["src/main/native/cpp/**/*.cpp"]),
copts = [
"-DHALSIM_InitExtension=HALSIM_InitExtension_WS_SERVER",
],
Expand Down
2 changes: 1 addition & 1 deletion simulation/halsim_xrp/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ wpilib_cc_library(
wpilib_cc_library(
name = "halsim_xrp_static",
srcs = glob([
"src/main/native/cpp/*",
"src/main/native/cpp/*.cpp",
"src/main/native/include/**/*.hpp",
]),
copts = [
Expand Down
12 changes: 10 additions & 2 deletions thirdparty/googletest/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@ load("//shared/bazel/rules:packaging.bzl", "package_static_cc_project")

wpilib_cc_library(
name = "googletest",
srcs = glob(["src/**"]),
hdrs = glob(["include/**"]),
srcs = glob([
"src/**/*.cc",
"src/**/*.cpp",
"src/**/*.h",
"src/**/*.hpp",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There don't seem to be any files in thirdparty/googletest/src that end with .hpp.

], allow_empty = True),
hdrs = glob([
"include/**/*.h",
"include/**/*.hpp",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There don't seem to be any files in thirdparty/googletest/include that end with .hpp.

], allow_empty = True),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we allowing empty glob expansions here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also shows up in cscore/BUILD.bazel and shared/bazel/rules/cc_rules.bzl.

hdrs_pkg_root = "include",
include_license_files = True,
includes = ["src/googletest"],
Expand Down
9 changes: 6 additions & 3 deletions wpilibc/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,13 @@ wpilib_cc_library(
srcs = [
":generate-version",
] + glob([
"src/main/native/cppcs/**",
"src/main/native/cpp/**",
"src/main/native/cppcs/**/*.cpp",
"src/main/native/cpp/**/*.cpp",
]),
hdrs = glob([
"src/main/native/include/**/*.hpp",
"src/main/native/include/**/*.mac"
]),
hdrs = glob(["src/main/native/include/**"]),
copts = [
# TODO(austin): this needs to be different for shared vs dynamic.
"-DDYNAMIC_CAMERA_SERVER",
Expand Down
6 changes: 4 additions & 2 deletions wpimath/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,14 @@ wpilib_cc_library(
name = "wpimath",
srcs = glob(
[
"src/main/native/cpp/**",
"src/main/native/cpp/**/*.cpp",
"src/generated/main/native/cpp/**/*.cpp",
],
exclude = ["src/main/native/cpp/jni/**"],
),
hdrs = glob(["src/main/native/include/**"]),
hdrs = glob([
"src/main/native/include/**/*.hpp",
]),
extra_hdr_pkg_files = [":protobuf_hdr_pkg"],
extra_src_pkg_files = [
":wpimath-java-jni-hdrs-pkg",
Expand Down
7 changes: 5 additions & 2 deletions wpinet/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,15 @@ cc_library(
wpilib_cc_library(
name = "wpinet",
srcs = glob(
["src/main/native/cpp/**"],
["src/main/native/cpp/**/*.cpp"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is missing the following files:

wpinet/src/main/native/cpp/WebSocketSerializer.hpp
wpinet/src/main/native/cpp/WebSocketDebug.hpp
wpinet/src/main/native/cpp/MulticastHandleManager.hpp

exclude = ["src/main/native/cpp/jni/**"],
) + [
":libuv-srcs",
] + ["native-srcs"],
hdrs = glob(["src/main/native/include/**/*"]),
hdrs = glob([
"src/main/native/include/**/*.h",
"src/main/native/include/**/*.hpp",
]),
extra_hdr_pkg_files = [":thirdparty-libuv-hdr-pkg"],
extra_src_pkg_files = [
":wpinet-java-jni-hdrs-pkg",
Expand Down
11 changes: 9 additions & 2 deletions wpiutil/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ third_party_cc_lib_helper(
name = "expected",
include_root = "src/main/native/thirdparty/expected/include",
visibility = ["//visibility:public"],
hdr_exts = [""]
)

third_party_cc_lib_helper(
Expand Down Expand Up @@ -145,6 +146,7 @@ third_party_cc_lib_helper(
name = "upb",
include_root = "src/main/native/thirdparty/upb/include",
src_root = "src/main/native/thirdparty/upb/src",
hdr_exts = [".h", ".inc"],
)

generate_resources(
Expand All @@ -165,13 +167,18 @@ filegroup(
wpilib_cc_library(
name = "wpiutil",
srcs = glob(
["src/main/native/cpp/**"],
["src/main/native/cpp/**/*.cpp"],
exclude = ["src/main/native/cpp/jni/**"],
) + [
":generate-resources",
":native-srcs",
],
hdrs = glob(["src/main/native/include/**/*"]),
hdrs = glob([
"src/main/native/include/**/*.h",
"src/main/native/include/**/*.hpp",
]) + [
"src/main/native/include/wpi/util/scope",
],
extra_src_pkg_files = [":wpiutil-java-jni-hdrs-pkg"],
includes = ["src/main/native/include"],
strip_include_prefix = "src/main/native/include",
Expand Down
6 changes: 4 additions & 2 deletions xrpVendordep/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ filegroup(
wpilib_cc_library(
name = "xrpVendordep",
srcs = glob([
"src/main/native/cpp/**",
"src/main/native/cpp/**/*.cpp",
]),
hdrs = glob([
"src/main/native/include/**/*.hpp",
]),
hdrs = glob(["src/main/native/include/**"]),
strip_include_prefix = "src/main/native/include",
visibility = ["//visibility:public"],
deps = [
Expand Down
Loading