Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 1 | load("@com_google_protobuf//:protobuf.bzl", "cc_proto_library") |
James Kuszmaul | 27da814 | 2019-07-21 16:13:55 -0700 | [diff] [blame] | 2 | load("//tools/cpp/emscripten:defs.bzl", "emcc_binary") |
James Kuszmaul | f385c46 | 2019-12-24 09:37:34 -0800 | [diff] [blame] | 3 | load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_python_library") |
James Kuszmaul | 27da814 | 2019-07-21 16:13:55 -0700 | [diff] [blame] | 4 | |
| 5 | emcc_binary( |
| 6 | name = "helloworld.html", |
| 7 | srcs = ["helloworld.cc"], |
| 8 | ) |
Brian Silverman | b67da23 | 2015-09-12 23:50:30 -0400 | [diff] [blame] | 9 | |
James Kuszmaul | 9a05bfd | 2019-08-03 17:03:38 -0700 | [diff] [blame] | 10 | emcc_binary( |
| 11 | name = "webgl.html", |
| 12 | srcs = ["webgl_draw_triangle.c"], |
| 13 | ) |
| 14 | |
| 15 | emcc_binary( |
| 16 | name = "webgl2.html", |
James Kuszmaul | 36816f3 | 2019-08-31 16:58:23 -0700 | [diff] [blame] | 17 | srcs = ["webgl2_benchmark.cc"], |
| 18 | html_shell = "minimal_shell.html", |
James Kuszmaul | 9a05bfd | 2019-08-03 17:03:38 -0700 | [diff] [blame] | 19 | # Enable WEBGL2 (-s is used by the emscripten |
| 20 | # compiler to specify sundry options). |
| 21 | linkopts = [ |
| 22 | "-s", |
| 23 | "USE_WEBGL2=1", |
James Kuszmaul | 36816f3 | 2019-08-31 16:58:23 -0700 | [diff] [blame] | 24 | "-s", |
| 25 | "TOTAL_MEMORY=" + repr(256 * 1024 * 1024), |
James Kuszmaul | 9a05bfd | 2019-08-03 17:03:38 -0700 | [diff] [blame] | 26 | ], |
| 27 | ) |
| 28 | |
James Kuszmaul | 6271cf7 | 2019-09-18 20:10:08 -0700 | [diff] [blame] | 29 | emcc_binary( |
| 30 | name = "plotter.html", |
| 31 | srcs = ["webgl2_plot_test.cc"], |
| 32 | html_shell = "minimal_shell.html", |
| 33 | linkopts = [ |
| 34 | "-s", |
| 35 | "USE_WEBGL2=1", |
| 36 | "-s", |
| 37 | "FULL_ES3=1", |
| 38 | "-s", |
| 39 | "TOTAL_MEMORY=" + repr(256 * 1024 * 1024), |
| 40 | ], |
| 41 | deps = [ |
| 42 | "//frc971/analysis/plotting:webgl2_animator", |
| 43 | "//frc971/analysis/plotting:webgl2_plotter", |
| 44 | ], |
| 45 | ) |
| 46 | |
Brian Silverman | fbe79b8 | 2015-09-12 15:10:54 -0400 | [diff] [blame] | 47 | cc_test( |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 48 | name = "gflags_build_test", |
| 49 | size = "small", |
| 50 | srcs = [ |
| 51 | "gflags.cc", |
| 52 | ], |
| 53 | deps = [ |
Brian Silverman | 16a923c | 2018-10-31 19:40:51 -0700 | [diff] [blame] | 54 | "@com_github_gflags_gflags//:gflags", |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 55 | ], |
Brian Silverman | fbe79b8 | 2015-09-12 15:10:54 -0400 | [diff] [blame] | 56 | ) |
Brian Silverman | b67da23 | 2015-09-12 23:50:30 -0400 | [diff] [blame] | 57 | |
Brian Silverman | 516ceb2 | 2015-11-27 01:29:05 -0500 | [diff] [blame] | 58 | cc_binary( |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 59 | name = "tcmalloc_build_test_binary", |
| 60 | srcs = [ |
| 61 | "tcmalloc.cc", |
| 62 | ], |
Brian Silverman | 516ceb2 | 2015-11-27 01:29:05 -0500 | [diff] [blame] | 63 | ) |
| 64 | |
| 65 | sh_test( |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 66 | name = "tcmalloc_build_test", |
| 67 | size = "small", |
| 68 | srcs = [ |
| 69 | "tcmalloc_test.sh", |
| 70 | ], |
| 71 | data = [ |
| 72 | ":tcmalloc_build_test_binary", |
| 73 | ], |
Brian Silverman | 516ceb2 | 2015-11-27 01:29:05 -0500 | [diff] [blame] | 74 | ) |
Brian Silverman | eb16fa4 | 2016-02-20 15:29:56 -0500 | [diff] [blame] | 75 | |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 76 | cc_proto_library( |
| 77 | name = "proto_build_test_library", |
| 78 | srcs = ["proto.proto"], |
| 79 | deps = [ |
| 80 | ":proto_build_test_library_base", |
| 81 | "@com_google_protobuf//:cc_wkt_protos", |
| 82 | ], |
Parker Schuh | 971588a | 2017-03-01 22:15:04 -0800 | [diff] [blame] | 83 | ) |
| 84 | |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 85 | cc_proto_library( |
| 86 | name = "proto_build_test_library_base", |
| 87 | srcs = ["proto_base.proto"], |
Brian Silverman | eb16fa4 | 2016-02-20 15:29:56 -0500 | [diff] [blame] | 88 | ) |
| 89 | |
| 90 | cc_test( |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 91 | name = "proto_build_test", |
| 92 | size = "small", |
| 93 | srcs = [ |
| 94 | "proto.cc", |
| 95 | ], |
| 96 | deps = [ |
| 97 | ":proto_build_test_library", |
| 98 | "//aos/testing:googletest", |
| 99 | ], |
Brian Silverman | eb16fa4 | 2016-02-20 15:29:56 -0500 | [diff] [blame] | 100 | ) |
James Kuszmaul | f385c46 | 2019-12-24 09:37:34 -0800 | [diff] [blame] | 101 | |
| 102 | flatbuffer_python_library( |
| 103 | name = "test_python_fbs", |
| 104 | srcs = ["test.fbs"], |
| 105 | namespace = "aos.examples", |
| 106 | tables = [ |
| 107 | "Foo", |
| 108 | "Bar", |
| 109 | ], |
| 110 | visibility = ["//visibility:public"], |
| 111 | ) |
| 112 | |
| 113 | py_test( |
| 114 | name = "python_fbs", |
| 115 | srcs = ["python_fbs.py"], |
| 116 | deps = [":test_python_fbs"], |
| 117 | ) |
Brian Silverman | 4fe44ea | 2020-02-02 12:56:42 -0800 | [diff] [blame] | 118 | |
| 119 | py_test( |
| 120 | name = "python3_opencv", |
| 121 | srcs = ["python_opencv.py"], |
| 122 | default_python_version = "PY3", |
| 123 | main = "python_opencv.py", |
| 124 | srcs_version = "PY2AND3", |
| 125 | deps = ["@opencv_contrib_nonfree_amd64//:python_opencv"], |
| 126 | ) |