Skip to content

Commit 87fd002

Browse files
committed
Support local generation for ign_tools
Signed-off-by: Michael Carroll <michael@openrobotics.org>
1 parent 8bfdda9 commit 87fd002

File tree

1 file changed

+32
-16
lines changed

1 file changed

+32
-16
lines changed

BUILD.bazel

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ load(
44
"IGNITION_VISIBILITY",
55
"cmake_configure_file",
66
"generate_include_header",
7+
"generate_yaml",
78
"ign_config_header",
89
"ign_export_header",
910
)
10-
1111
load(
1212
":ign_msg_gen.bzl",
1313
"get_proto_headers",
@@ -50,13 +50,10 @@ ign_export_header(
5050
visibility = ["//visibility:private"],
5151
)
5252

53-
public_headers_no_gen = [
54-
"include/ignition/msgs/Factory.hh",
55-
"include/ignition/msgs/Filesystem.hh",
56-
"include/ignition/msgs/SuppressWarning.hh",
57-
"include/ignition/msgs/Utility.hh",
58-
"include/ignition/msgs/detail/SuppressWarning.hh",
59-
]
53+
public_headers_no_gen = glob([
54+
"include/ignition/msgs/*.hh",
55+
"include/ignition/msgs/detail/*.hh",
56+
])
6057

6158
protos = glob(["proto/ignition/msgs/*.proto"])
6259

@@ -121,28 +118,29 @@ ign_msg_gen(
121118
cc_library(
122119
name = "ign_msgs",
123120
srcs = [
124-
":ignmsgs_proto_cc",
125121
"src/Factory.cc",
126122
"src/Filesystem.cc",
127123
"src/Utility.cc",
124+
":ignmsgs_proto_cc",
128125
],
129126
hdrs = public_headers,
130127
includes = ["include"],
131128
deps = [
132129
":ignmsgs_proto_cc",
133130
IGNITION_ROOT + "ign_math",
134-
"@tinyxml2",
135131
"@com_google_protobuf//:protobuf",
132+
"@tinyxml2",
136133
],
137134
)
138135

139136
# use shared library only when absolutely needd
140137
cc_binary(
141-
name = "libignition-msgs6.so",
142-
includes = ["include"],
143-
linkopts = [
144-
"-Wl,-soname,libignition-msgs6.so",
138+
name = "libignition-msgs.so",
139+
srcs = [
140+
"src/ign.cc",
141+
"src/ign.hh",
145142
],
143+
includes = ["include"],
146144
linkshared = True,
147145
linkstatic = True,
148146
deps = [
@@ -167,6 +165,24 @@ cc_binary(
167165
],
168166
)]
169167

170-
exports_files(["src/cmd/cmdmsgs.rb.in"])
168+
cmake_configure_file(
169+
name = "msgs.rb",
170+
src = "src/cmd/cmdmsgs.rb.in",
171+
out = "cmdmsgs.rb",
172+
cmakelists = ["CMakeLists.txt"],
173+
defines = [
174+
"library_location=libignition-msgs.so",
175+
"PROJECT_VERSION_FULL=%d.%d.%d" % (PROJECT_MAJOR, PROJECT_MINOR, PROJECT_PATCH), # noqa
176+
"IGN_LIBRARY_NAME=%s" % [PROJECT_NAME],
177+
],
178+
)
179+
180+
CMDS = " - msg : Print information about messages."
171181

172-
exports_files(["CMakeLists.txt"])
182+
generate_yaml(
183+
name = "msgs",
184+
commands = CMDS,
185+
library_name = PROJECT_NAME,
186+
library_version = "%d.%d.%d" % (PROJECT_MAJOR, PROJECT_MINOR, PROJECT_PATCH),
187+
ruby_target = "msgs.rb",
188+
)

0 commit comments

Comments
 (0)