blob: 4e1da3dc1c53248f7f246a392d872aa13644487c [file] [log] [blame]
Alex Perrycb7da4b2019-08-28 19:35:56 -07001load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
James Kuszmaul78e29ac2020-07-28 21:07:03 -07002load("//aos:config.bzl", "aos_config")
Parker Schuh18dbbb42017-10-18 21:45:33 -07003
Philipp Schradercc016b32021-12-30 08:59:58 -08004package(default_visibility = ["//visibility:public"])
5
Parker Schuh18dbbb42017-10-18 21:45:33 -07006cc_binary(
Austin Schuh55a13dc2019-01-27 22:39:03 -08007 name = "basic_test",
8 testonly = 1,
9 srcs = ["basic_test.cc"],
Austin Schuhc5fa6d92022-02-25 14:36:28 -080010 data = [":aos_config"],
Philipp Schraderdada1072020-11-24 11:34:46 -080011 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh55a13dc2019-01-27 22:39:03 -080012 deps = [
13 ":basic",
James Kuszmaul78e29ac2020-07-28 21:07:03 -070014 ":basic_goal_fbs",
15 ":basic_output_fbs",
16 ":basic_position_fbs",
17 ":basic_status_fbs",
Alex Perrycb7da4b2019-08-28 19:35:56 -070018 "//aos/events:shm_event_loop",
Austin Schuh55a13dc2019-01-27 22:39:03 -080019 "//aos/testing:googletest",
Austin Schuh0a3c9d42021-07-15 22:36:24 -070020 "//frc971/control_loops:control_loop_test",
Austin Schuh55a13dc2019-01-27 22:39:03 -080021 "//frc971/control_loops:state_feedback_loop",
22 "//frc971/control_loops:team_number_test_environment",
23 ],
Parker Schuh18dbbb42017-10-18 21:45:33 -070024)
25
26cc_library(
Austin Schuh55a13dc2019-01-27 22:39:03 -080027 name = "basic",
28 srcs = ["basic.cc"],
29 hdrs = ["basic.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -080030 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh55a13dc2019-01-27 22:39:03 -080031 deps = [
James Kuszmaul78e29ac2020-07-28 21:07:03 -070032 ":basic_goal_fbs",
33 ":basic_output_fbs",
34 ":basic_position_fbs",
35 ":basic_status_fbs",
James Kuszmaul61750662021-06-21 21:32:33 -070036 "//frc971/control_loops:control_loop",
Austin Schuh55a13dc2019-01-27 22:39:03 -080037 ],
Parker Schuh18dbbb42017-10-18 21:45:33 -070038)
39
Alex Perrycb7da4b2019-08-28 19:35:56 -070040flatbuffer_cc_library(
James Kuszmaul78e29ac2020-07-28 21:07:03 -070041 name = "basic_goal_fbs",
Austin Schuh55a13dc2019-01-27 22:39:03 -080042 srcs = [
James Kuszmaul78e29ac2020-07-28 21:07:03 -070043 "basic_goal.fbs",
44 ],
45 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -080046 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul78e29ac2020-07-28 21:07:03 -070047)
48
49flatbuffer_cc_library(
50 name = "basic_output_fbs",
51 srcs = [
52 "basic_output.fbs",
53 ],
54 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -080055 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul78e29ac2020-07-28 21:07:03 -070056)
57
58flatbuffer_cc_library(
59 name = "basic_status_fbs",
60 srcs = [
61 "basic_status.fbs",
62 ],
63 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -080064 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul78e29ac2020-07-28 21:07:03 -070065)
66
67flatbuffer_cc_library(
68 name = "basic_position_fbs",
69 srcs = [
70 "basic_position.fbs",
71 ],
72 gen_reflections = 1,
Philipp Schraderdada1072020-11-24 11:34:46 -080073 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul78e29ac2020-07-28 21:07:03 -070074)
75
76aos_config(
Austin Schuhc5fa6d92022-02-25 14:36:28 -080077 name = "aos_config",
James Kuszmaul78e29ac2020-07-28 21:07:03 -070078 src = "codelab.json",
79 flatbuffers = [
80 ":basic_goal_fbs",
81 ":basic_position_fbs",
82 ":basic_status_fbs",
83 ":basic_output_fbs",
84 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080085 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul78e29ac2020-07-28 21:07:03 -070086 deps = [
Austin Schuhc5fa6d92022-02-25 14:36:28 -080087 "//frc971/input:aos_config",
Austin Schuh55a13dc2019-01-27 22:39:03 -080088 ],
Parker Schuh18dbbb42017-10-18 21:45:33 -070089)