@@ -51,7 +51,10 @@ py_binary(
51
51
52
52
genrule (
53
53
name = "gen_build_info_h" ,
54
- srcs = ["CHANGES.md" , "build_info.h.tmpl" ],
54
+ srcs = [
55
+ "CHANGES.md" ,
56
+ "build_info.h.tmpl" ,
57
+ ],
55
58
outs = ["glslang/build_info.h" ],
56
59
cmd = "$(location build_info) $$(dirname $(location CHANGES.md)) -i $(location build_info.h.tmpl) -o $(location glslang/build_info.h)" ,
57
60
tools = [":build_info" ],
@@ -92,10 +95,8 @@ cc_library(
92
95
) + [
93
96
"OGLCompilersDLL/InitializeDll.cpp" ,
94
97
] + select ({
95
- "@bazel_tools//src/conditions:windows" :
96
- ["glslang/OSDependent/Windows/ossource.cpp" ],
97
- "//conditions:default" :
98
- ["glslang/OSDependent/Unix/ossource.cpp" ],
98
+ "@bazel_tools//src/conditions:windows" : ["glslang/OSDependent/Windows/ossource.cpp" ],
99
+ "//conditions:default" : ["glslang/OSDependent/Unix/ossource.cpp" ],
99
100
}),
100
101
hdrs = glob ([
101
102
"glslang/HLSL/*.h" ,
@@ -118,7 +119,10 @@ cc_library(
118
119
],
119
120
linkopts = select ({
120
121
"@bazel_tools//src/conditions:windows" : ["" ],
121
- "//conditions:default" : ["-lm" , "-lpthread" ],
122
+ "//conditions:default" : [
123
+ "-lm" ,
124
+ "-lpthread" ,
125
+ ],
122
126
}),
123
127
linkstatic = 1 ,
124
128
)
@@ -224,18 +228,6 @@ cc_binary(
224
228
],
225
229
)
226
230
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
-
239
231
cc_library (
240
232
name = "glslang_test_lib" ,
241
233
testonly = 1 ,
@@ -249,16 +241,9 @@ cc_library(
249
241
"gtests/main.cpp" ,
250
242
],
251
243
copts = COMMON_COPTS ,
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
- }),
244
+ defines = [
245
+ "GLSLANG_TEST_DIRECTORY='\" USE_FLAG_INSTEAD\" '" ,
246
+ ],
262
247
linkstatic = 1 ,
263
248
deps = [
264
249
":SPIRV" ,
@@ -281,9 +266,13 @@ GLSLANG_TESTS = glob(
281
266
[cc_test (
282
267
name = test_file .replace ("gtests/" , "" ).replace (".FromFile.cpp" , "" ) + "_test" ,
283
268
srcs = [test_file ],
269
+ args = [
270
+ "--test-root" ,
271
+ "$(rootpath Test)" ,
272
+ ],
284
273
copts = COMMON_COPTS ,
285
274
data = [
286
- ":test_files " ,
275
+ "Test " ,
287
276
],
288
277
deps = [
289
278
":SPIRV" ,
0 commit comments