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 | |
Brian Silverman | fbe79b8 | 2015-09-12 15:10:54 -0400 | [diff] [blame] | 29 | cc_test( |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 30 | name = "gflags_build_test", |
| 31 | size = "small", |
| 32 | srcs = [ |
| 33 | "gflags.cc", |
| 34 | ], |
| 35 | deps = [ |
Brian Silverman | 16a923c | 2018-10-31 19:40:51 -0700 | [diff] [blame] | 36 | "@com_github_gflags_gflags//:gflags", |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 37 | ], |
Brian Silverman | fbe79b8 | 2015-09-12 15:10:54 -0400 | [diff] [blame] | 38 | ) |
Brian Silverman | b67da23 | 2015-09-12 23:50:30 -0400 | [diff] [blame] | 39 | |
Brian Silverman | 516ceb2 | 2015-11-27 01:29:05 -0500 | [diff] [blame] | 40 | cc_binary( |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 41 | name = "tcmalloc_build_test_binary", |
| 42 | srcs = [ |
| 43 | "tcmalloc.cc", |
| 44 | ], |
Brian Silverman | 516ceb2 | 2015-11-27 01:29:05 -0500 | [diff] [blame] | 45 | ) |
| 46 | |
| 47 | sh_test( |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 48 | name = "tcmalloc_build_test", |
| 49 | size = "small", |
| 50 | srcs = [ |
| 51 | "tcmalloc_test.sh", |
| 52 | ], |
| 53 | data = [ |
| 54 | ":tcmalloc_build_test_binary", |
| 55 | ], |
Brian Silverman | 516ceb2 | 2015-11-27 01:29:05 -0500 | [diff] [blame] | 56 | ) |
Brian Silverman | eb16fa4 | 2016-02-20 15:29:56 -0500 | [diff] [blame] | 57 | |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 58 | cc_proto_library( |
| 59 | name = "proto_build_test_library", |
| 60 | srcs = ["proto.proto"], |
| 61 | deps = [ |
| 62 | ":proto_build_test_library_base", |
| 63 | "@com_google_protobuf//:cc_wkt_protos", |
| 64 | ], |
Parker Schuh | 971588a | 2017-03-01 22:15:04 -0800 | [diff] [blame] | 65 | ) |
| 66 | |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 67 | cc_proto_library( |
| 68 | name = "proto_build_test_library_base", |
| 69 | srcs = ["proto_base.proto"], |
Brian Silverman | eb16fa4 | 2016-02-20 15:29:56 -0500 | [diff] [blame] | 70 | ) |
| 71 | |
| 72 | cc_test( |
Austin Schuh | f972444 | 2018-10-28 20:30:21 -0700 | [diff] [blame] | 73 | name = "proto_build_test", |
| 74 | size = "small", |
| 75 | srcs = [ |
| 76 | "proto.cc", |
| 77 | ], |
| 78 | deps = [ |
| 79 | ":proto_build_test_library", |
| 80 | "//aos/testing:googletest", |
| 81 | ], |
Brian Silverman | eb16fa4 | 2016-02-20 15:29:56 -0500 | [diff] [blame] | 82 | ) |
James Kuszmaul | f385c46 | 2019-12-24 09:37:34 -0800 | [diff] [blame] | 83 | |
| 84 | flatbuffer_python_library( |
| 85 | name = "test_python_fbs", |
| 86 | srcs = ["test.fbs"], |
| 87 | namespace = "aos.examples", |
| 88 | tables = [ |
| 89 | "Foo", |
| 90 | "Bar", |
| 91 | ], |
| 92 | visibility = ["//visibility:public"], |
| 93 | ) |
| 94 | |
| 95 | py_test( |
| 96 | name = "python_fbs", |
| 97 | srcs = ["python_fbs.py"], |
| 98 | deps = [":test_python_fbs"], |
| 99 | ) |