Skip to content

Commit 18b35a0

Browse files
author
Michael Carroll
committed
Incorporate feedback and cleanups
Signed-off-by: Michael Carroll <michael@openrobotics.org>
1 parent 26d3f98 commit 18b35a0

2 files changed

Lines changed: 55 additions & 40 deletions

File tree

BUILD.bazel

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
11
load(
2-
"//ign_bazel:cmake_configure_file.bzl",
2+
"//ign_bazel:build_defs.bzl",
3+
"IGNITION_VISIBILITY",
34
"cmake_configure_file",
4-
)
5-
load(
6-
"//ign_bazel:generate_include_header.bzl",
75
"generate_include_header",
8-
)
9-
load(
10-
"//ign_bazel:ign_export_header.bzl",
6+
"ign_config_header",
117
"ign_export_header",
128
)
139

14-
package(default_visibility = ["//visibility:public"])
10+
package(
11+
default_visibility = IGNITION_VISIBILITY,
12+
features = [
13+
"-parse_headers",
14+
"-layering_check",
15+
],
16+
)
17+
18+
licenses(["notice"])
19+
20+
exports_files(["LICENSE"])
1521

1622
PROJECT_NAME = "ignition-math"
23+
1724
PROJECT_MAJOR = 6
18-
PROJECT_MINOR = 4
25+
26+
PROJECT_MINOR = 6
27+
1928
PROJECT_PATCH = 0
2029

2130
# Generates config.hh based on the version numbers in CMake code.
22-
cmake_configure_file(
31+
ign_config_header(
2332
name = "config",
2433
src = "include/ignition/math/config.hh.in",
25-
out = "include/ignition/math/config.hh",
2634
cmakelists = ["CMakeLists.txt"],
27-
defines = [
28-
"PROJECT_VERSION_MAJOR=%d" % (PROJECT_MAJOR),
29-
"PROJECT_MAJOR_VERSION=%d" % (PROJECT_MAJOR),
30-
"PROJECT_MINOR_VERSION=%d" % (PROJECT_MINOR),
31-
"PROJECT_PATCH_VERSION=%d" % (PROJECT_PATCH),
32-
"PROJECT_VERSION=%d.%d" % (PROJECT_MAJOR, PROJECT_MINOR),
33-
"PROJECT_VERSION_FULL=%d.%d.%d" % (PROJECT_MAJOR, PROJECT_MINOR, PROJECT_PATCH), # noqa
34-
"PROJECT_NAME_NO_VERSION=%s" % (PROJECT_NAME),
35-
],
36-
visibility = ["//visibility:private"],
35+
project_name = "ignition-math",
36+
project_version = (PROJECT_MAJOR, PROJECT_MINOR, PROJECT_PATCH),
3737
)
3838

3939
ign_export_header(
4040
name = "include/ignition/math/Export.hh",
41-
lib_name = "ignition-math",
4241
export_base = "IGNITION_MATH",
42+
lib_name = "ignition-math",
4343
visibility = ["//visibility:private"],
4444
)
4545

@@ -119,8 +119,8 @@ public_headers = public_headers_no_gen + [
119119
"include/ignition/math.hh",
120120
]
121121

122-
cc_binary(
123-
name = "libignition-math6.so",
122+
cc_library(
123+
name = "ign_math",
124124
srcs = [
125125
"src/Angle.cc",
126126
"src/AxisAlignedBox.cc",
@@ -144,27 +144,28 @@ cc_binary(
144144
"src/Stopwatch.cc",
145145
"src/Temperature.cc",
146146
"src/Vector3Stats.cc",
147-
] + private_headers + public_headers,
147+
] + private_headers,
148+
hdrs = public_headers,
148149
includes = ["include"],
149-
linkopts = ["-Wl,-soname,libignition-math6.so"],
150-
linkshared = True,
151-
visibility = [],
152150
)
153151

154-
cc_library(
155-
name = "ign_math",
156-
srcs = ["libignition-math6.so"],
157-
hdrs = public_headers,
152+
# use shared library only when absolutely needd
153+
cc_binary(
154+
name = "libignition-math6.so",
158155
includes = ["include"],
159-
visibility = ["//visibility:public"],
156+
linkopts = ["-Wl,-soname,libignition-math6.so"],
157+
linkshared = True,
158+
deps = [
159+
":ign_math",
160+
],
160161
)
161162

162163
[cc_test(
163164
name = src.replace("/", "_").replace(".cc", "").replace("src_", ""),
164165
srcs = [src],
165166
deps = [
166167
":ign_math",
167-
"@gtest//:gtest",
168+
"@gtest",
168169
"@gtest//:gtest_main",
169170
],
170171
) for src in glob(
@@ -173,4 +174,3 @@ cc_library(
173174
"src/graph/*_TEST.cc",
174175
],
175176
)]
176-

eigen3/BUILD.bazel

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
load(
2+
"//ign_bazel:build_defs.bzl",
3+
"IGNITION_ROOT",
4+
"IGNITION_VISIBILITY",
5+
)
6+
7+
package(
8+
default_visibility = IGNITION_VISIBILITY,
9+
features = [
10+
"-layering_check",
11+
],
12+
)
13+
14+
licenses(["notice"])
15+
16+
exports_files(["LICENSE"])
17+
118
public_headers = [
219
"include/ignition/math/eigen3/Conversions.hh",
320
]
@@ -6,25 +23,23 @@ cc_library(
623
name = "eigen3",
724
srcs = public_headers,
825
hdrs = public_headers,
26+
includes = ["include"],
927
deps = [
1028
"@eigen3",
11-
"//ign_math",
29+
IGNITION_ROOT + "ign_math",
1230
],
13-
includes = ["include"],
14-
visibility = ["//visibility:public"]
1531
)
1632

1733
[cc_test(
1834
name = src.replace("/", "_").replace(".cc", "").replace("src_", ""),
1935
srcs = [src],
2036
deps = [
2137
":eigen3",
22-
"@gtest//:gtest",
38+
"@gtest",
2339
"@gtest//:gtest_main",
2440
],
2541
) for src in glob(
2642
[
2743
"src/*_TEST.cc",
2844
],
2945
)]
30-

0 commit comments

Comments
 (0)