|
| 1 | +load("@rules_gazebo//gazebo:headers.bzl", "gz_configure_header", "gz_export_header") |
| 2 | +load("@rules_license//rules:license.bzl", "license") |
| 3 | + |
| 4 | +package( |
| 5 | + default_applicable_licenses = [":license"], |
| 6 | + features = [ |
| 7 | + "layering_check", |
| 8 | + "parse_headers", |
| 9 | + ], |
| 10 | +) |
| 11 | + |
| 12 | +license( |
| 13 | + name = "license", |
| 14 | + package_name = "gz-rendering", |
| 15 | +) |
| 16 | + |
| 17 | +licenses(["notice"]) |
| 18 | + |
| 19 | +exports_files([ |
| 20 | + "package.xml", |
| 21 | + "LICENSE", |
| 22 | + "MODULE.bazel", |
| 23 | +]) |
| 24 | + |
| 25 | +gz_configure_header( |
| 26 | + name = "Config", |
| 27 | + src = "include/gz/rendering/config.hh.in", |
| 28 | + package_xml = "package.xml", |
| 29 | +) |
| 30 | + |
| 31 | +gz_export_header( |
| 32 | + name = "Export", |
| 33 | + out = "include/gz/rendering/Export.hh", |
| 34 | + export_base = "GZ_RENDERING", |
| 35 | + lib_name = "gz-rendering", |
| 36 | +) |
| 37 | + |
| 38 | +public_headers_no_gen = glob([ |
| 39 | + "include/gz/rendering/*.hh", |
| 40 | + "include/gz/rendering/base/*.hh", |
| 41 | +]) |
| 42 | + |
| 43 | +public_headers = public_headers_no_gen + [ |
| 44 | + "include/gz/rendering/config.hh", |
| 45 | + "include/gz/rendering/Export.hh", |
| 46 | +] |
| 47 | + |
| 48 | +sources = glob( |
| 49 | + [ |
| 50 | + "src/*.cc", |
| 51 | + "src/base/*.cc", |
| 52 | + "src/bazel/*.cc", |
| 53 | + ], |
| 54 | + exclude = ["src/*_TEST.cc"], |
| 55 | +) |
| 56 | + |
| 57 | +cc_library( |
| 58 | + name = "gz-rendering", |
| 59 | + srcs = sources, |
| 60 | + hdrs = public_headers, |
| 61 | + includes = ["include"], |
| 62 | + local_defines = [ |
| 63 | + "GZ_RENDERING_PLUGIN_PATH='\"\"'", |
| 64 | + "GZ_RENDERING_RELATIVE_RESOURCE_PATH='\"\"'", |
| 65 | + "GZ_RENDERING_ENGINE_RELATIVE_INSTALL_DIR='\"\"'", |
| 66 | + ], |
| 67 | + visibility = ["//visibility:public"], |
| 68 | + deps = [ |
| 69 | + "@gz-common", |
| 70 | + "@gz-common//events", |
| 71 | + "@gz-common//geospatial", |
| 72 | + "@gz-common//graphics", |
| 73 | + "@gz-math", |
| 74 | + "@gz-plugin//:loader", |
| 75 | + "@gz-utils//:ImplPtr", |
| 76 | + "@gz-utils//:SuppressWarning", |
| 77 | + ], |
| 78 | +) |
| 79 | + |
| 80 | +test_sources = glob([ |
| 81 | + "src/*_TEST.cc", |
| 82 | +]) |
| 83 | + |
| 84 | +[ |
| 85 | + cc_test( |
| 86 | + name = src.replace("/", "_").replace(".cc", "").replace("src_", ""), |
| 87 | + srcs = [src], |
| 88 | + deps = [ |
| 89 | + ":gz-rendering", |
| 90 | + "@googletest//:gtest", |
| 91 | + "@googletest//:gtest_main", |
| 92 | + "@gz-common//geospatial", |
| 93 | + ], |
| 94 | + ) |
| 95 | + for src in test_sources |
| 96 | +] |
0 commit comments