Skip to content

Commit 90cbf4b

Browse files
author
Michael Carroll
authored
Merge 5794ee7 into 1e9ce65
2 parents 1e9ce65 + 5794ee7 commit 90cbf4b

2 files changed

Lines changed: 143 additions & 0 deletions

File tree

BUILD.bazel

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
load(
2+
"//ign_bazel:build_defs.bzl",
3+
"IGNITION_FEATURES",
4+
"IGNITION_VISIBILITY",
5+
"cmake_configure_file",
6+
"generate_include_header",
7+
"ign_config_header",
8+
"ign_export_header",
9+
)
10+
11+
package(
12+
default_visibility = IGNITION_VISIBILITY,
13+
features = IGNITION_FEATURES,
14+
)
15+
16+
licenses(["notice"])
17+
18+
exports_files(["LICENSE"])
19+
20+
PROJECT_NAME = "ignition-math"
21+
22+
PROJECT_MAJOR = 6
23+
24+
PROJECT_MINOR = 8
25+
26+
PROJECT_PATCH = 0
27+
28+
# Generates config.hh based on the version numbers in CMake code.
29+
ign_config_header(
30+
name = "config",
31+
src = "include/ignition/math/config.hh.in",
32+
cmakelists = ["CMakeLists.txt"],
33+
project_name = "ignition-math",
34+
project_version = (PROJECT_MAJOR, PROJECT_MINOR, PROJECT_PATCH),
35+
)
36+
37+
ign_export_header(
38+
name = "include/ignition/math/Export.hh",
39+
export_base = "IGNITION_MATH",
40+
lib_name = "ignition-math",
41+
visibility = ["//visibility:private"],
42+
)
43+
44+
public_headers_no_gen = glob([
45+
"include/ignition/math/*.hh",
46+
"include/ignition/math/detail/*.hh",
47+
"include/ignition/math/graph/*.hh",
48+
])
49+
50+
private_headers = glob(["src/*.hh"])
51+
52+
sources = glob(
53+
["src/*.cc"],
54+
exclude = ["src/*_TEST.cc"],
55+
)
56+
57+
generate_include_header(
58+
name = "mathhh_genrule",
59+
out = "include/ignition/math.hh",
60+
hdrs = public_headers_no_gen + [
61+
"include/ignition/math/config.hh",
62+
"include/ignition/math/Export.hh",
63+
],
64+
)
65+
66+
public_headers = public_headers_no_gen + [
67+
"include/ignition/math/config.hh",
68+
"include/ignition/math/Export.hh",
69+
"include/ignition/math.hh",
70+
]
71+
72+
cc_library(
73+
name = "ign_math",
74+
srcs = sources + private_headers,
75+
hdrs = public_headers,
76+
includes = ["include"],
77+
)
78+
79+
# use shared library only when absolutely needd
80+
cc_binary(
81+
name = "libignition-math6.so",
82+
includes = ["include"],
83+
linkopts = ["-Wl,-soname,libignition-math6.so"],
84+
linkshared = True,
85+
deps = [
86+
":ign_math",
87+
],
88+
)
89+
90+
[cc_test(
91+
name = src.replace("/", "_").replace(".cc", "").replace("src_", ""),
92+
srcs = [src],
93+
deps = [
94+
":ign_math",
95+
"@gtest",
96+
"@gtest//:gtest_main",
97+
],
98+
) for src in glob(
99+
[
100+
"src/*_TEST.cc",
101+
"src/graph/*_TEST.cc",
102+
],
103+
)]

eigen3/BUILD.bazel

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
load(
2+
"//ign_bazel:build_defs.bzl",
3+
"IGNITION_ROOT",
4+
"IGNITION_VISIBILITY",
5+
)
6+
7+
package(
8+
default_visibility = IGNITION_VISIBILITY,
9+
)
10+
11+
licenses(["notice"])
12+
13+
public_headers = [
14+
"include/ignition/math/eigen3/Conversions.hh",
15+
]
16+
17+
cc_library(
18+
name = "eigen3",
19+
srcs = public_headers,
20+
hdrs = public_headers,
21+
includes = ["include"],
22+
deps = [
23+
"@eigen3",
24+
IGNITION_ROOT + "ign_math",
25+
],
26+
)
27+
28+
[cc_test(
29+
name = src.replace("/", "_").replace(".cc", "").replace("src_", ""),
30+
srcs = [src],
31+
deps = [
32+
":eigen3",
33+
"@gtest",
34+
"@gtest//:gtest_main",
35+
],
36+
) for src in glob(
37+
[
38+
"src/*_TEST.cc",
39+
],
40+
)]

0 commit comments

Comments
 (0)