| 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 *WPILibVersion = \"2017-frc971\";", |
| "EOF", |
| ]), |
| ) |
| |
| _header_dirs = [ |
| 'wpilibc/shared/include', |
| 'wpilibc/athena/include', |
| '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', |
| 'GearTooth', |
| 'Ultrasonic', |
| 'Victor', |
| 'TalonSRX', |
| 'CANTalon', |
| 'CANJaguar', |
| 'PIDController', |
| 'Spark', |
| 'SD540', |
| 'RobotDrive', |
| 'Jaguar', |
| 'ADXL345_SPI', |
| 'DoubleSolenoid', |
| 'AnalogPotentiometer', |
| 'ADXL362', |
| 'AnalogGyro', |
| 'AnalogAccelerometer', |
| 'CameraServer', |
| 'ADXRS450_Gyro', |
| 'GyroBase', |
| 'IterativeRobot', |
| 'MotorSafety', |
| 'MotorSafetyHelper', |
| 'SafePWM', |
| 'SpeedController', |
| 'PWMSpeedController', |
| 'SerialPort', |
| 'OSSerialPort', |
| 'SerialHelper', |
| 'XboxController', |
| 'GenericHID', |
| 'GamepadBase', |
| 'PIDSource', |
| 'Potentiometer', |
| 'JoystickBase', |
| 'Joystick', |
| 'Log', |
| 'CANSpeedController', |
| '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/athena/include/WPILib.h', |
| 'hal/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/athena/src/*.cpp', |
| 'wpilibc/athena/src/Internal/*.cpp', |
| 'wpilibc/shared/src/**/*.cpp', |
| |
| 'hal/lib/athena/*.cpp', |
| 'hal/lib/athena/cpp/*.cpp', |
| 'hal/lib/athena/ctre/*.cpp', |
| 'hal/lib/shared/handles/*.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_2017:ntcore', |
| '@allwpilib_ni_libraries_repo_2017//:ni-libraries', |
| '//aos/common/logging', |
| ], |
| hdrs = _h_hdrs + _hpp_hdrs + [ |
| 'wpilibc/shared/include/CircularBuffer.inc', |
| 'wpilibc/athena/include/Task.inc', |
| ], |
| includes = _header_dirs, |
| linkopts = [ |
| '-lpthread', |
| ], |
| defines = [ |
| 'WPILIB2017=1', |
| ], |
| restricted_to = ['//tools:roborio'], |
| ) |