Skip to content

Commit 171ad60

Browse files
Bazel layering check fixes with clang (#684)
Signed-off-by: Shameek Ganguly <[email protected]>
1 parent fd1b819 commit 171ad60

File tree

9 files changed

+55
-28
lines changed

9 files changed

+55
-28
lines changed

BUILD.bazel

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,13 @@ cc_library(
7373
includes = ["include"],
7474
visibility = ["//visibility:public"],
7575
deps = [
76+
"@gz-math",
7677
"@gz-utils//:ImplPtr",
78+
"@gz-utils//:NeverDestroyed",
79+
"@gz-utils//:SuppressWarning",
7780
"@gz-utils//log:Logger",
78-
"@gz-math//:gz-math",
7981
"@libuuid",
82+
"@spdlog",
8083
],
8184
)
8285

@@ -94,9 +97,10 @@ test_sources = glob(
9497
copts = ["-fexceptions"],
9598
deps = [
9699
":gz-common",
97-
"//testing:testing",
100+
"//testing",
98101
"@googletest//:gtest",
99102
"@googletest//:gtest_main",
103+
"@gz-math",
100104
"@gz-utils//:ExtraTestMacros",
101105
],
102106
) for src in test_sources]

MODULE.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ bazel_dep(name = "freeimage", version = "3.19.10")
1212
bazel_dep(name = "googletest", version = "1.14.0")
1313
bazel_dep(name = "remotery", version = "1.0.0")
1414
bazel_dep(name = "rules_license", version = "1.0.0")
15+
bazel_dep(name = "spdlog", version = "1.12.0")
1516
bazel_dep(name = "tinyxml2", version = "10.0.0")
1617
bazel_dep(name = "libuuid", version = "2.39.3.bcr.1")
1718

events/BUILD.bazel

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ cc_library(
4141
visibility = ["//visibility:public"],
4242
deps = [
4343
"//:gz-common",
44+
"@gz-math",
4445
"@gz-utils//:ImplPtr",
46+
"@gz-utils//:SuppressWarning",
4547
],
4648
)
4749

@@ -50,8 +52,9 @@ cc_library(
5052
srcs = [src],
5153
deps = [
5254
":events",
53-
"//testing:testing",
54-
"@googletest//:gtest_main",
55+
"//:gz-common",
56+
"//testing",
5557
"@googletest//:gtest",
58+
"@googletest//:gtest_main",
5659
],
5760
) for src in test_sources]

geospatial/BUILD.bazel

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ sources = glob(
2020
exclude = [
2121
"src/*_TEST.cc",
2222
# \todo(iche033) include Dem.cc once gdal dep is available.
23-
"src/Dem.cc"
23+
"src/Dem.cc",
2424
],
2525
)
2626

2727
test_sources = glob(
2828
include = ["src/*_TEST.cc"],
2929
# \todo(iche033) include this test once gdal dep is available.
30-
exclude = ["src/Dem_TEST.cc"]
30+
exclude = ["src/Dem_TEST.cc"],
3131
)
3232

3333
gz_export_header(
@@ -49,36 +49,37 @@ cc_library(
4949
"-Wno-unused-value",
5050
"-fexceptions",
5151
],
52+
# \todo(iche033) remove this macro once gdal dep is available.
53+
defines = [
54+
"BAZEL_DISABLE_DEM_LOADER=1",
55+
],
5256
includes = ["include"],
5357
visibility = ["//visibility:public"],
5458
deps = [
5559
"//:gz-common",
56-
"//graphics:graphics",
60+
"//graphics",
5761
"@gz-utils//:ImplPtr",
62+
"@gz-math",
5863
# \todo(iche033) gdal is not in BCR yet
5964
# "@gdal",
6065
],
61-
# \todo(iche033) remove this macro once gdal dep is available.
62-
defines = [
63-
"BAZEL_DISABLE_DEM_LOADER=1"
64-
]
6566
)
6667

6768
[cc_test(
6869
name = src.replace("/", "_").replace(".cc", "").replace("src_", ""),
6970
srcs = [src],
7071
data = ["//test:data"],
72+
# \todo(iche033) remove this macro once gdal dep is available.
73+
defines = [
74+
"BAZEL_DISABLE_DEM_LOADER=1",
75+
],
7176
env = {
7277
"GZ_BAZEL": "1",
7378
},
7479
deps = [
7580
":geospatial",
76-
"//testing:testing",
81+
"//testing",
7782
"@googletest//:gtest",
7883
"@googletest//:gtest_main",
7984
],
80-
# \todo(iche033) remove this macro once gdal dep is available.
81-
defines = [
82-
"BAZEL_DISABLE_DEM_LOADER=1"
83-
]
8485
) for src in test_sources]

graphics/BUILD.bazel

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public_headers_no_gen = glob([
1414
])
1515

1616
vhacd_header = ["src/VHACD/VHACD.h"]
17+
1718
tiny_obj_loader_header = ["src/tiny_obj_loader.h"]
1819

1920
sources = glob(
@@ -48,7 +49,8 @@ cc_library(
4849
"//:gz-common",
4950
"@assimp",
5051
"@cdt",
51-
"@freeimage//:freeimage",
52+
"@freeimage",
53+
"@gz-math",
5254
"@gz-utils//:ImplPtr",
5355
"@tinyxml2",
5456
],
@@ -63,8 +65,11 @@ cc_library(
6365
},
6466
deps = [
6567
":graphics",
66-
"//testing:testing",
68+
"//:gz-common",
69+
"//testing",
6770
"@googletest//:gtest",
6871
"@googletest//:gtest_main",
72+
"@gz-math",
73+
"@tinyxml2",
6974
],
7075
) for src in test_sources]

io/BUILD.bazel

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ cc_library(
4242
visibility = ["//visibility:public"],
4343
deps = [
4444
"//:gz-common",
45+
"@gz-math",
4546
"@gz-utils//:ImplPtr",
4647
],
4748
)
@@ -54,10 +55,10 @@ cc_library(
5455
},
5556
deps = [
5657
":io",
57-
"//testing:testing",
58+
"//:gz-common",
59+
"//testing",
5860
"@googletest//:gtest",
5961
"@googletest//:gtest_main",
60-
62+
"@gz-math",
6163
],
6264
) for src in test_sources]
63-

profiler/BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ cc_library(
6161
],
6262
includes = ["include"],
6363
deps = [
64+
":Export",
6465
":ProfilerImplInterface",
6566
"//:gz-common",
6667
"@remotery",
@@ -155,6 +156,7 @@ cc_test(
155156
}),
156157
deps = [
157158
":profiler",
159+
"//:gz-common",
158160
"@googletest//:gtest",
159161
"@googletest//:gtest_main",
160162
],
@@ -170,6 +172,7 @@ cc_test(
170172
}),
171173
deps = [
172174
":profiler",
175+
"//:gz-common",
173176
"@googletest//:gtest",
174177
"@googletest//:gtest_main",
175178
],
@@ -184,7 +187,9 @@ cc_test(
184187
"//conditions:default": ["BAZEL_SKIP_PROFILER_TEST=1"],
185188
}),
186189
deps = [
190+
":ProfilerImplInterface",
187191
":profiler",
192+
"//:gz-common",
188193
"@googletest//:gtest",
189194
"@googletest//:gtest_main",
190195
],
@@ -196,6 +201,7 @@ cc_test(
196201
deps = [
197202
":RemoteryProfilerImpl",
198203
":profiler",
204+
"//:gz-common",
199205
"@googletest//:gtest",
200206
"@googletest//:gtest_main",
201207
"@remotery",

test/BUILD.bazel

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ cc_test(
1414
},
1515
deps = [
1616
"//:gz-common",
17-
"//testing:testing",
17+
"//testing",
18+
"@googletest//:gtest",
1819
"@googletest//:gtest_main",
1920
],
2021
)
@@ -34,11 +35,11 @@ cc_test(
3435
},
3536
deps = [
3637
"//:gz-common",
37-
"//testing:testing",
38-
"//graphics:graphics",
39-
"@gz-math//:gz-math",
38+
"//graphics",
39+
"//testing",
4040
"@googletest//:gtest",
4141
"@googletest//:gtest_main",
42+
"@gz-math//:gz-math",
4243
],
4344
)
4445

testing/BUILD.bazel

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ public_headers = glob(
1919
include = [
2020
"include/gz/common/testing/*.hh",
2121
"include/gz/common/testing/detail/*.hh",
22-
]) + [
23-
"include/gz/common/testing/Export.hh"
24-
]
22+
],
23+
) + [
24+
"include/gz/common/testing/Export.hh",
25+
]
2526

2627
cc_library(
2728
name = "testing",
@@ -37,6 +38,8 @@ cc_library(
3738
visibility = ["//visibility:public"],
3839
deps = [
3940
"//:gz-common",
41+
"@gz-utils//:ImplPtr",
42+
"@gz-utils//:SuppressWarning",
4043
],
4144
)
4245

@@ -45,6 +48,7 @@ cc_test(
4548
srcs = ["src/AutoLogFixture_TEST.cc"],
4649
deps = [
4750
":testing",
51+
"//:gz-common",
4852
"@googletest//:gtest",
4953
"@googletest//:gtest_main",
5054
],
@@ -59,6 +63,7 @@ cc_test(
5963
},
6064
deps = [
6165
":testing",
66+
"//:gz-common",
6267
"@googletest//:gtest",
6368
"@googletest//:gtest_main",
6469
],

0 commit comments

Comments
 (0)