blob: 2d789d7c83a00752d6c53fdee439512b8efeca77 [file] [log] [blame]
Brian Silvermancee260a2015-12-24 16:27:51 -08001licenses(['notice'])
2
3_header_dirs = [
4 'wpilibc/wpilibC++/include',
5 'wpilibc/wpilibC++Devices/include',
6 'wpilibc/shared/include',
7 'wpilibc/Athena/include',
8 'hal/include',
9 'hal/lib/Athena/FRC_FPGA_ChipObject',
10 'hal/lib/Athena',
11]
12
Brian Silvermane1de6902016-02-20 21:11:14 -050013# Names of WPILib "devices" I don't want to deal with making trivial updates to
14# chop out various ugliness or have to vet for sanity.
15_excluded_devices = [
16 'ADXL345_I2C',
17 'GearTooth',
18 'Ultrasonic',
19 'Victor',
20 'TalonSRX',
21 'CANTalon',
22 'CANJaguar',
23 'PIDController',
24 'Spark',
25 'Servo',
26 'VictorSP',
27 'SD540',
28 'RobotDrive',
29 'Jaguar',
30 'ADXL345_SPI',
31 'DoubleSolenoid',
32 'AnalogPotentiometer',
33 'ADXL362',
34 'AnalogGyro',
35 'AnalogAccelerometer',
36]
37
38# Whole subdirectories of WPILib we don't want around.
39_excluded_shared_directories = [
40 'SmartDashboard',
41 'LiveWindow',
42 'Commands',
43 'Buttons',
44 'Filters',
45]
46
47# Header files we don't want to have.
48_bad_hdrs = ([
49 'wpilibc/Athena/include/WPILib.h',
50] + ['wpilibc/shared/include/%s/**/*' % d
51 for d in _excluded_shared_directories] +
52 ['wpilibc/*/include/%s.h' % d for d in _excluded_devices])
Brian Silvermanb200c172017-01-02 17:35:35 -080053_h_hdrs = glob([d + '/**/*.h' for d in _header_dirs], exclude=_bad_hdrs)
54_hpp_hdrs = glob([d + '/**/*.hpp' for d in _header_dirs], exclude=_bad_hdrs)
Brian Silvermane1de6902016-02-20 21:11:14 -050055
Brian Silvermancee260a2015-12-24 16:27:51 -080056cc_library(
57 name = 'wpilib',
Austin Schuh2a70f4b2016-11-25 23:05:57 -080058 visibility = ['//third_party:__pkg__'],
Brian Silvermancee260a2015-12-24 16:27:51 -080059 srcs = glob([
60 'wpilibc/Athena/src/*.cpp',
61 'wpilibc/Athena/src/Internal/*.cpp',
62 'wpilibc/shared/src/**/*.cpp',
63
64 'hal/lib/Athena/*.cpp',
65 'hal/lib/Athena/cpp/*.cpp',
66 'hal/lib/Athena/ctre/*.cpp',
67 'hal/lib/Shared/*.cpp',
Brian Silvermanb200c172017-01-02 17:35:35 -080068 ], exclude=(['wpilibc/shared/src/%s/**/*' % d for d in _excluded_shared_directories] +
69 ['wpilibc/*/src/%s.cpp' % d for d in _excluded_devices])),
Brian Silvermancee260a2015-12-24 16:27:51 -080070 copts = [
71 '-Wno-unused-parameter',
72 '-Wno-switch-enum',
73 '-Wno-attributes',
74 '-Wno-cast-align',
75 '-Wno-cast-qual',
76 '-Wno-deprecated-declarations',
77 '-Wno-error',
78 ],
79 deps = [
80 '//third_party/ntcore_2016:ntcore',
81 '//external:ni-libraries',
Brian Silvermane9aa68e2016-02-21 01:59:18 -050082 '//aos/common/logging',
Brian Silvermancee260a2015-12-24 16:27:51 -080083 ],
Brian Silvermane1de6902016-02-20 21:11:14 -050084 hdrs = _h_hdrs + _hpp_hdrs + ['wpilibc/shared/include/Task.inc'],
Brian Silvermancee260a2015-12-24 16:27:51 -080085 includes = _header_dirs,
86 linkopts = [
87 '-lpthread',
88 ],
89 defines = [
90 'WPILIB2016=1',
91 ],
92)