| licenses(['notice']) |
| |
| genrule( |
| name = 'wpilib_version', |
| outs = ['shared/src/WPILibVersion.cpp'], |
| cmd = '\n'.join([ |
| "cat > \"$@\" << EOF", |
| "// Autogenerated file! Do not manually edit this file.", |
| "#include \"WPILibVersion.h\"", |
| "const char* GetWPILibVersion() {", |
| " return \"2018-frc971\";", |
| "}", |
| "EOF", |
| ]), |
| ) |
| |
| _header_dirs = [ |
| 'wpilibc/src/main/native/include', |
| #'wpilibc/shared/include', |
| #'wpilibc/athena/include', |
| 'hal/src/main/native/include', |
| 'hal/src/main/native/athena', |
| 'hal/src/main/native/include/HAL/cpp', |
| #'hal/include', |
| #'hal/lib/athena', |
| ] |
| |
| # Names of WPILib "devices" I don't want to deal with making trivial updates to |
| # chop out various ugliness or have to vet for sanity. |
| _excluded_devices = [ |
| 'ADXL345_I2C', |
| 'ADXL345_SPI', |
| 'ADXL362', |
| 'ADXRS450_Gyro', |
| 'AnalogAccelerometer', |
| #'AnalogGyro', |
| 'AnalogPotentiometer', |
| 'CANJaguar', |
| 'CANSpeedController', |
| 'CANTalon', |
| 'CameraServer', |
| 'DoubleSolenoid', |
| 'GamepadBase', |
| 'GearTooth', |
| 'GenericHID', |
| #'GyroBase', |
| 'IterativeRobot', |
| 'Jaguar', |
| 'Joystick', |
| 'JoystickBase', |
| #'Log', |
| #'MotorSafety', |
| #'MotorSafetyHelper', |
| 'OSSerialPort', |
| #'PIDController', |
| #'PIDSource', |
| #'PWMSpeedController', |
| 'Potentiometer', |
| 'RobotDrive', |
| 'SD540', |
| #'SafePWM', |
| #'SerialHelper', |
| #'SerialPort', |
| 'Spark', |
| #'SpeedController', |
| 'TalonSRX', |
| 'Ultrasonic', |
| 'Victor', |
| 'XboxController', |
| #'visa', |
| ] |
| |
| # Whole subdirectories of WPILib we don't want around. |
| _excluded_directories = [ |
| #'SmartDashboard', |
| #'LiveWindow', |
| #'Commands', |
| #'Buttons', |
| #'Filters', |
| 'LabView', |
| 'vision', |
| ] |
| |
| # Header files we don't want to have. |
| _bad_hdrs = ([ |
| 'wpilibc/src/main/native/include/WPILib.h', |
| 'hal/src/main/native/include/HAL/LabVIEW/HAL.h', |
| #'wpilibc/**/Accelerometer.*', |
| ] + ['**/%s/**' % d for d in _excluded_directories] + |
| ['**/%s.*' % d for d in _excluded_devices]) |
| _h_hdrs = glob([d + '/**/*.h' for d in _header_dirs], exclude=_bad_hdrs) |
| _hpp_hdrs = glob([d + '/**/*.hpp' for d in _header_dirs], exclude=_bad_hdrs) |
| |
| cc_library( |
| name = 'wpilib', |
| visibility = ['//third_party:__pkg__'], |
| srcs = glob([ |
| 'wpilibc/src/main/native/cpp/*.cpp', |
| 'wpilibc/src/main/native/cpp/interfaces/*.cpp', |
| 'wpilibc/src/main/native/cpp/LiveWindow/*.cpp', |
| 'wpilibc/src/main/native/cpp/Commands/*.cpp', |
| 'wpilibc/src/main/native/cpp/SmartDashboard/*.cpp', |
| |
| 'hal/src/main/native/athena/*.cpp', |
| 'hal/src/main/native/athena/cpp/*.cpp', |
| 'hal/src/main/native/athena/ctre/*.cpp', |
| 'hal/src/main/native/shared/handles/*.cpp', |
| 'wpilibc/src/main/native/cpp/Internal/*.cpp', |
| ], exclude = ( |
| ['**/%s/**' % d for d in _excluded_directories] + |
| ['**/%s.*' % d for d in _excluded_devices] + [ |
| #'wpilibc/**/Accelerometer.*', |
| ])) + [ |
| ':wpilib_version', |
| ], |
| copts = [ |
| '-Wno-unused-parameter', |
| '-Wno-switch-enum', |
| '-Wno-attributes', |
| '-Wno-cast-align', |
| '-Wno-cast-qual', |
| '-Wno-deprecated-declarations', |
| '-Wno-error', |
| #'-Wno-unused-const-variable', |
| ], |
| deps = [ |
| '//third_party/ntcore_2018:ntcore', |
| '@allwpilib_ni_libraries_repo_2018//:ni-libraries', |
| '//aos/common/logging', |
| ], |
| hdrs = _h_hdrs + _hpp_hdrs + [ |
| 'wpilibc/src/main/native/include/circular_buffer.inc', |
| 'wpilibc/src/main/native/include/SpeedControllerGroup.inc', |
| ], |
| includes = _header_dirs, |
| linkopts = [ |
| '-lpthread', |
| ], |
| defines = [ |
| 'WPILIB2018=1', |
| ], |
| restricted_to = ['//tools:roborio'], |
| ) |