Skip to content

Commit 983698b

Browse files
committed
Revert "Merge pull request KhronosGroup#2371 from RafaelMarinheiro/master"
This reverts commit f257e0e, reversing changes made to 8f0c6bd.
1 parent 9f9360d commit 983698b

File tree

1 file changed

+29
-18
lines changed

1 file changed

+29
-18
lines changed

BUILD.bazel

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,7 @@ py_binary(
5151

5252
genrule(
5353
name = "gen_build_info_h",
54-
srcs = [
55-
"CHANGES.md",
56-
"build_info.h.tmpl",
57-
],
54+
srcs = ["CHANGES.md", "build_info.h.tmpl"],
5855
outs = ["glslang/build_info.h"],
5956
cmd = "$(location build_info) $$(dirname $(location CHANGES.md)) -i $(location build_info.h.tmpl) -o $(location glslang/build_info.h)",
6057
tools = [":build_info"],
@@ -95,8 +92,10 @@ cc_library(
9592
) + [
9693
"OGLCompilersDLL/InitializeDll.cpp",
9794
] + select({
98-
"@bazel_tools//src/conditions:windows": ["glslang/OSDependent/Windows/ossource.cpp"],
99-
"//conditions:default": ["glslang/OSDependent/Unix/ossource.cpp"],
95+
"@bazel_tools//src/conditions:windows":
96+
["glslang/OSDependent/Windows/ossource.cpp"],
97+
"//conditions:default":
98+
["glslang/OSDependent/Unix/ossource.cpp"],
10099
}),
101100
hdrs = glob([
102101
"glslang/HLSL/*.h",
@@ -119,10 +118,7 @@ cc_library(
119118
],
120119
linkopts = select({
121120
"@bazel_tools//src/conditions:windows": [""],
122-
"//conditions:default": [
123-
"-lm",
124-
"-lpthread",
125-
],
121+
"//conditions:default": ["-lm", "-lpthread"],
126122
}),
127123
linkstatic = 1,
128124
)
@@ -228,6 +224,18 @@ cc_binary(
228224
],
229225
)
230226

227+
filegroup(
228+
name = "test_files",
229+
srcs = glob(
230+
["Test/**"],
231+
exclude = [
232+
"Test/bump",
233+
"Test/glslangValidator",
234+
"Test/runtests",
235+
],
236+
),
237+
)
238+
231239
cc_library(
232240
name = "glslang_test_lib",
233241
testonly = 1,
@@ -241,9 +249,16 @@ cc_library(
241249
"gtests/main.cpp",
242250
],
243251
copts = COMMON_COPTS,
244-
defines = [
245-
"GLSLANG_TEST_DIRECTORY='\"USE_FLAG_INSTEAD\"'",
246-
],
252+
data = [":test_files"],
253+
defines = select({
254+
# Unfortunately we can't use $(location) in cc_library at the moment.
255+
# See https://github.com/bazelbuild/bazel/issues/1023
256+
# So we'll specify the path manually.
257+
"@bazel_tools//src/conditions:windows":
258+
["GLSLANG_TEST_DIRECTORY='\"../../../../../Test\"'"],
259+
"//conditions:default":
260+
["GLSLANG_TEST_DIRECTORY='\"Test\"'"],
261+
}),
247262
linkstatic = 1,
248263
deps = [
249264
":SPIRV",
@@ -266,13 +281,9 @@ GLSLANG_TESTS = glob(
266281
[cc_test(
267282
name = test_file.replace("gtests/", "").replace(".FromFile.cpp", "") + "_test",
268283
srcs = [test_file],
269-
args = [
270-
"--test-root",
271-
"$(rootpath Test)",
272-
],
273284
copts = COMMON_COPTS,
274285
data = [
275-
"Test",
286+
":test_files",
276287
],
277288
deps = [
278289
":SPIRV",

0 commit comments

Comments
 (0)