Make sure link order always works correctly for 2018 phoenix
Apparently recent changes resulted in bazel picking a link order that
doesn't always work. Force it to avoid random linker errors.
Change-Id: I1b7c7a2ace24e2491bb53dfacb5175a87f6ca204
diff --git a/third_party/Phoenix-frc-lib/BUILD b/third_party/Phoenix-frc-lib/BUILD
index dcfd0dc..d735d52 100644
--- a/third_party/Phoenix-frc-lib/BUILD
+++ b/third_party/Phoenix-frc-lib/BUILD
@@ -1,6 +1,14 @@
# It also restricts use to only with CTRE products and a roboRIO in FRC.
licenses(["permissive"])
+cc_library(
+ name = "libs",
+ srcs = [
+ "libraries/driver/lib/libCTRE_PhoenixCCI.a",
+ ],
+ restricted_to = ["//tools:roborio"],
+)
+
# Excludes motor/sensor code because those have reliances on WPILib.
cc_library(
name = "phoenix",
@@ -16,9 +24,7 @@
"**/MotorControl/**",
"**/Sensors/**",
],
- ) + [
- "libraries/driver/lib/libCTRE_PhoenixCCI.a",
- ],
+ ),
hdrs = glob(
include = [
"cpp/include/**/*.h",
@@ -38,6 +44,7 @@
restricted_to = ["//tools:roborio"],
visibility = ["//visibility:public"],
deps = [
+ ":libs",
"//third_party/allwpilib_2018:hal",
],
)