-
Notifications
You must be signed in to change notification settings - Fork 20
/
BUILD.bazel
142 lines (128 loc) · 3.1 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
load(
"@gz//bazel/skylark:build_defs.bzl",
"GZ_ROOT",
"GZ_VISIBILITY",
"gz_configure_header",
"gz_export_header",
"gz_include_header",
)
package(
default_visibility = GZ_VISIBILITY,
)
licenses(["notice"]) # Apache-2.0
gz_configure_header(
name = "config",
src = "core/include/gz/plugin/config.hh.in",
cmakelists = ["CMakeLists.txt"],
package = "plugin",
)
gz_export_header(
name = "core/include/gz/plugin/Export.hh",
export_base = "GZ_PLUGIN",
lib_name = "gz-plugin",
visibility = ["//visibility:private"],
)
public_headers_no_gen = glob([
"core/include/gz/plugin/*.hh",
"core/include/gz/plugin/detail/*.hh",
])
sources = glob(
["core/src/*.cc"],
exclude = ["core/src/*_TEST.cc"],
)
gz_include_header(
name = "pluginhh_genrule",
out = "core/include/gz/plugin.hh",
hdrs = public_headers_no_gen + [
"core/include/gz/plugin/Export.hh",
"core/include/gz/plugin/config.hh",
],
)
public_headers = public_headers_no_gen + [
"core/include/gz/plugin/config.hh",
"core/include/gz/plugin/Export.hh",
"core/include/gz/plugin.hh",
]
cc_library(
name = "core",
srcs = sources,
hdrs = public_headers,
includes = ["core/include"],
deps = [
GZ_ROOT + "utils",
],
)
[cc_test(
name = src.replace("/", "_").replace(".cc", "").replace("src_", ""),
srcs = [src],
deps = [
":core",
"@gtest",
"@gtest//:gtest_main",
],
) for src in glob(
[
"core/src/*_TEST.cc",
],
)]
cc_library(
name = "register",
hdrs = [
"register/include/gz/plugin/Register.hh",
"register/include/gz/plugin/RegisterMore.hh",
"register/include/gz/plugin/RegisterStatic.hh",
"register/include/gz/plugin/detail/Common.hh",
"register/include/gz/plugin/detail/Register.hh",
"register/include/gz/plugin/detail/RegisterStatic.hh",
],
includes = [
"register/include",
],
deps = [
":core",
":loader",
],
)
gz_export_header(
name = "loader/include/gz/plugin/loader/Export.hh",
export_base = "GZ_PLUGIN_LOADER",
lib_name = "gz-plugin-loader",
visibility = ["//visibility:private"],
)
cc_library(
name = "loader",
srcs = [
"loader/src/Loader.cc",
"loader/src/detail/Registry.cc",
"loader/src/detail/StaticRegistry.cc",
],
hdrs = [
"loader/include/gz/plugin/Loader.hh",
"loader/include/gz/plugin/detail/Loader.hh",
"loader/include/gz/plugin/detail/Registry.hh",
"loader/include/gz/plugin/detail/StaticRegistry.hh",
"loader/include/gz/plugin/loader/Export.hh",
],
includes = ["loader/include"],
deps = [
":core",
GZ_ROOT + "utils",
],
)
cc_test(
name = "Loader_TEST",
srcs = [
"loader/src/Loader_TEST.cc",
":config",
],
defines = [
'GzDummyPlugins_LIB=\\"./plugin/test/libGzDummyPlugins.so\\"',
],
deps = [
":core",
":loader",
GZ_ROOT + "plugin/test:test_plugins",
"@gtest",
"@gtest//:gtest_main",
],
)