forked from gazebosim/gz-common
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BUILD.bazel
95 lines (82 loc) · 1.89 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
load(
"@gz//bazel/skylark:build_defs.bzl",
"GZ_FEATURES",
"GZ_ROOT",
"GZ_VISIBILITY",
"gz_configure_header",
"gz_export_header",
"gz_include_header",
)
package(
default_visibility = GZ_VISIBILITY,
features = GZ_FEATURES,
)
licenses(["notice"]) # Apache-2.0
exports_files(["LICENSE"])
gz_configure_header(
name = "config",
src = "include/gz/common/config.hh.in",
cmakelists = ["CMakeLists.txt"],
package = "common",
)
gz_export_header(
name = "include/gz/common/Export.hh",
export_base = "GZ_COMMON",
lib_name = "gz-common",
visibility = ["//visibility:private"],
)
public_headers_no_gen = glob([
"include/gz/common/*.hh",
"include/gz/common/detail/*.hh",
"include/gz/common/graph/*.hh",
])
private_headers = glob(["src/*.hh"])
sources = glob(
["src/*.cc"],
exclude = [
"src/Plugin.cc",
"src/PluginLoader.cc",
"src/*_TEST.cc",
],
)
gz_include_header(
name = "commonhh_genrule",
out = "include/gz/common.hh",
hdrs = public_headers_no_gen + [
"include/gz/common/config.hh",
"include/gz/common/Export.hh",
],
)
public_headers = public_headers_no_gen + [
"include/gz/common/config.hh",
"include/gz/common/Export.hh",
"include/gz/common.hh",
]
cc_library(
name = "common",
srcs = sources + private_headers,
hdrs = public_headers,
includes = ["include"],
deps = [
GZ_ROOT + "utils",
GZ_ROOT + "math",
"@uuid",
],
)
test_sources = glob(
include = ["src/*_TEST.cc"],
exclude = [
"src/PluginUtils_TEST.cc",
"src/PluginLoader_TEST.cc",
],
)
[cc_test(
name = src.replace("/", "_").replace(".cc", "").replace("src_", ""),
srcs = [src],
deps = [
":common",
GZ_ROOT + "common/testing",
"@gtest",
"@gtest//:gtest_main",
],
) for src in test_sources]