@@ -51,165 +51,184 @@ spirv_tools_dir = glslang_spirv_tools_dir
51
51
config (" glslang_public" ) {
52
52
include_dirs = [ " ." ]
53
53
54
- defines = [ " ENABLE_HLSL=1" ]
54
+ if (! glslang_angle ) {
55
+ defines = [ " ENABLE_HLSL=1" ]
56
+ }
55
57
}
56
58
57
- source_set (" glslang_sources" ) {
58
- public_configs = [ " :glslang_public" ]
59
+ template (" glslang_sources_common" ) {
60
+ source_set (target_name ) {
61
+ public_configs = [ " :glslang_public" ]
59
62
60
- sources = [
61
- " OGLCompilersDLL/InitializeDll.cpp" ,
62
- " OGLCompilersDLL/InitializeDll.h" ,
63
- " SPIRV/GLSL.ext.AMD.h" ,
64
- " SPIRV/GLSL.ext.EXT.h" ,
65
- " SPIRV/GLSL.ext.KHR.h" ,
66
- " SPIRV/GLSL.ext.NV.h" ,
67
- " SPIRV/GLSL.std.450.h" ,
68
- " SPIRV/GlslangToSpv.cpp" ,
69
- " SPIRV/GlslangToSpv.h" ,
70
- " SPIRV/InReadableOrder.cpp" ,
71
- " SPIRV/Logger.cpp" ,
72
- " SPIRV/Logger.h" ,
73
- " SPIRV/NonSemanticDebugPrintf.h" ,
74
- " SPIRV/SPVRemapper.cpp" ,
75
- " SPIRV/SPVRemapper.h" ,
76
- " SPIRV/SpvBuilder.cpp" ,
77
- " SPIRV/SpvBuilder.h" ,
78
- " SPIRV/SpvPostProcess.cpp" ,
79
- " SPIRV/SpvTools.cpp" ,
80
- " SPIRV/SpvTools.h" ,
81
- " SPIRV/bitutils.h" ,
82
- " SPIRV/disassemble.cpp" ,
83
- " SPIRV/disassemble.h" ,
84
- " SPIRV/doc.cpp" ,
85
- " SPIRV/doc.h" ,
86
- " SPIRV/hex_float.h" ,
87
- " SPIRV/spirv.hpp" ,
88
- " SPIRV/spvIR.h" ,
89
- " glslang/GenericCodeGen/CodeGen.cpp" ,
90
- " glslang/GenericCodeGen/Link.cpp" ,
91
- " glslang/HLSL/hlslAttributes.cpp" ,
92
- " glslang/HLSL/hlslAttributes.h" ,
93
- " glslang/HLSL/hlslGrammar.cpp" ,
94
- " glslang/HLSL/hlslGrammar.h" ,
95
- " glslang/HLSL/hlslOpMap.cpp" ,
96
- " glslang/HLSL/hlslOpMap.h" ,
97
- " glslang/HLSL/hlslParseables.cpp" ,
98
- " glslang/HLSL/hlslParseables.h" ,
99
- " glslang/HLSL/hlslParseHelper.cpp" ,
100
- " glslang/HLSL/hlslParseHelper.h" ,
101
- " glslang/HLSL/hlslScanContext.cpp" ,
102
- " glslang/HLSL/hlslScanContext.h" ,
103
- " glslang/HLSL/hlslTokens.h" ,
104
- " glslang/HLSL/hlslTokenStream.cpp" ,
105
- " glslang/HLSL/hlslTokenStream.h" ,
106
- " glslang/Include/BaseTypes.h" ,
107
- " glslang/Include/Common.h" ,
108
- " glslang/Include/ConstantUnion.h" ,
109
- " glslang/Include/InfoSink.h" ,
110
- " glslang/Include/InitializeGlobals.h" ,
111
- " glslang/Include/PoolAlloc.h" ,
112
- " glslang/Include/ResourceLimits.h" ,
113
- " glslang/Include/ShHandle.h" ,
114
- " glslang/Include/Types.h" ,
115
- " glslang/Include/arrays.h" ,
116
- " glslang/Include/intermediate.h" ,
117
- " glslang/Include/revision.h" ,
118
- " glslang/MachineIndependent/Constant.cpp" ,
119
- " glslang/MachineIndependent/InfoSink.cpp" ,
120
- " glslang/MachineIndependent/Initialize.cpp" ,
121
- " glslang/MachineIndependent/Initialize.h" ,
122
- " glslang/MachineIndependent/IntermTraverse.cpp" ,
123
- " glslang/MachineIndependent/Intermediate.cpp" ,
124
- " glslang/MachineIndependent/LiveTraverser.h" ,
125
- " glslang/MachineIndependent/ParseContextBase.cpp" ,
126
- " glslang/MachineIndependent/ParseHelper.cpp" ,
127
- " glslang/MachineIndependent/ParseHelper.h" ,
128
- " glslang/MachineIndependent/PoolAlloc.cpp" ,
129
- " glslang/MachineIndependent/RemoveTree.cpp" ,
130
- " glslang/MachineIndependent/RemoveTree.h" ,
131
- " glslang/MachineIndependent/Scan.cpp" ,
132
- " glslang/MachineIndependent/Scan.h" ,
133
- " glslang/MachineIndependent/ScanContext.h" ,
134
- " glslang/MachineIndependent/ShaderLang.cpp" ,
135
- " glslang/MachineIndependent/SymbolTable.cpp" ,
136
- " glslang/MachineIndependent/SymbolTable.h" ,
137
- " glslang/MachineIndependent/Versions.cpp" ,
138
- " glslang/MachineIndependent/Versions.h" ,
139
- " glslang/MachineIndependent/attribute.cpp" ,
140
- " glslang/MachineIndependent/attribute.h" ,
141
- " glslang/MachineIndependent/gl_types.h" ,
142
- " glslang/MachineIndependent/glslang_tab.cpp" ,
143
- " glslang/MachineIndependent/glslang_tab.cpp.h" ,
144
- " glslang/MachineIndependent/intermOut.cpp" ,
145
- " glslang/MachineIndependent/iomapper.cpp" ,
146
- " glslang/MachineIndependent/iomapper.h" ,
147
- " glslang/MachineIndependent/limits.cpp" ,
148
- " glslang/MachineIndependent/linkValidate.cpp" ,
149
- " glslang/MachineIndependent/localintermediate.h" ,
150
- " glslang/MachineIndependent/parseConst.cpp" ,
151
- " glslang/MachineIndependent/parseVersions.h" ,
152
- " glslang/MachineIndependent/preprocessor/Pp.cpp" ,
153
- " glslang/MachineIndependent/preprocessor/PpAtom.cpp" ,
154
- " glslang/MachineIndependent/preprocessor/PpContext.cpp" ,
155
- " glslang/MachineIndependent/preprocessor/PpContext.h" ,
156
- " glslang/MachineIndependent/preprocessor/PpScanner.cpp" ,
157
- " glslang/MachineIndependent/preprocessor/PpTokens.cpp" ,
158
- " glslang/MachineIndependent/preprocessor/PpTokens.h" ,
159
- " glslang/MachineIndependent/propagateNoContraction.cpp" ,
160
- " glslang/MachineIndependent/propagateNoContraction.h" ,
161
- " glslang/MachineIndependent/reflection.cpp" ,
162
- " glslang/MachineIndependent/reflection.h" ,
163
- " glslang/OSDependent/osinclude.h" ,
164
- " glslang/Public/ShaderLang.h" ,
165
- ]
63
+ sources = [
64
+ " OGLCompilersDLL/InitializeDll.cpp" ,
65
+ " OGLCompilersDLL/InitializeDll.h" ,
66
+ " SPIRV/GLSL.ext.AMD.h" ,
67
+ " SPIRV/GLSL.ext.EXT.h" ,
68
+ " SPIRV/GLSL.ext.KHR.h" ,
69
+ " SPIRV/GLSL.ext.NV.h" ,
70
+ " SPIRV/GLSL.std.450.h" ,
71
+ " SPIRV/GlslangToSpv.cpp" ,
72
+ " SPIRV/GlslangToSpv.h" ,
73
+ " SPIRV/InReadableOrder.cpp" ,
74
+ " SPIRV/Logger.cpp" ,
75
+ " SPIRV/Logger.h" ,
76
+ " SPIRV/NonSemanticDebugPrintf.h" ,
77
+ " SPIRV/SPVRemapper.cpp" ,
78
+ " SPIRV/SPVRemapper.h" ,
79
+ " SPIRV/SpvBuilder.cpp" ,
80
+ " SPIRV/SpvBuilder.h" ,
81
+ " SPIRV/SpvPostProcess.cpp" ,
82
+ " SPIRV/SpvTools.cpp" ,
83
+ " SPIRV/SpvTools.h" ,
84
+ " SPIRV/bitutils.h" ,
85
+ " SPIRV/disassemble.cpp" ,
86
+ " SPIRV/disassemble.h" ,
87
+ " SPIRV/doc.cpp" ,
88
+ " SPIRV/doc.h" ,
89
+ " SPIRV/hex_float.h" ,
90
+ " SPIRV/spirv.hpp" ,
91
+ " SPIRV/spvIR.h" ,
92
+ " glslang/GenericCodeGen/CodeGen.cpp" ,
93
+ " glslang/GenericCodeGen/Link.cpp" ,
94
+ " glslang/Include/BaseTypes.h" ,
95
+ " glslang/Include/Common.h" ,
96
+ " glslang/Include/ConstantUnion.h" ,
97
+ " glslang/Include/InfoSink.h" ,
98
+ " glslang/Include/InitializeGlobals.h" ,
99
+ " glslang/Include/PoolAlloc.h" ,
100
+ " glslang/Include/ResourceLimits.h" ,
101
+ " glslang/Include/ShHandle.h" ,
102
+ " glslang/Include/Types.h" ,
103
+ " glslang/Include/arrays.h" ,
104
+ " glslang/Include/intermediate.h" ,
105
+ " glslang/Include/revision.h" ,
106
+ " glslang/MachineIndependent/Constant.cpp" ,
107
+ " glslang/MachineIndependent/InfoSink.cpp" ,
108
+ " glslang/MachineIndependent/Initialize.cpp" ,
109
+ " glslang/MachineIndependent/Initialize.h" ,
110
+ " glslang/MachineIndependent/IntermTraverse.cpp" ,
111
+ " glslang/MachineIndependent/Intermediate.cpp" ,
112
+ " glslang/MachineIndependent/LiveTraverser.h" ,
113
+ " glslang/MachineIndependent/ParseContextBase.cpp" ,
114
+ " glslang/MachineIndependent/ParseHelper.cpp" ,
115
+ " glslang/MachineIndependent/ParseHelper.h" ,
116
+ " glslang/MachineIndependent/PoolAlloc.cpp" ,
117
+ " glslang/MachineIndependent/RemoveTree.cpp" ,
118
+ " glslang/MachineIndependent/RemoveTree.h" ,
119
+ " glslang/MachineIndependent/Scan.cpp" ,
120
+ " glslang/MachineIndependent/Scan.h" ,
121
+ " glslang/MachineIndependent/ScanContext.h" ,
122
+ " glslang/MachineIndependent/ShaderLang.cpp" ,
123
+ " glslang/MachineIndependent/SymbolTable.cpp" ,
124
+ " glslang/MachineIndependent/SymbolTable.h" ,
125
+ " glslang/MachineIndependent/Versions.cpp" ,
126
+ " glslang/MachineIndependent/Versions.h" ,
127
+ " glslang/MachineIndependent/attribute.cpp" ,
128
+ " glslang/MachineIndependent/attribute.h" ,
129
+ " glslang/MachineIndependent/gl_types.h" ,
130
+ " glslang/MachineIndependent/glslang_tab.cpp" ,
131
+ " glslang/MachineIndependent/glslang_tab.cpp.h" ,
132
+ " glslang/MachineIndependent/intermOut.cpp" ,
133
+ " glslang/MachineIndependent/iomapper.cpp" ,
134
+ " glslang/MachineIndependent/iomapper.h" ,
135
+ " glslang/MachineIndependent/limits.cpp" ,
136
+ " glslang/MachineIndependent/linkValidate.cpp" ,
137
+ " glslang/MachineIndependent/localintermediate.h" ,
138
+ " glslang/MachineIndependent/parseConst.cpp" ,
139
+ " glslang/MachineIndependent/parseVersions.h" ,
140
+ " glslang/MachineIndependent/preprocessor/Pp.cpp" ,
141
+ " glslang/MachineIndependent/preprocessor/PpAtom.cpp" ,
142
+ " glslang/MachineIndependent/preprocessor/PpContext.cpp" ,
143
+ " glslang/MachineIndependent/preprocessor/PpContext.h" ,
144
+ " glslang/MachineIndependent/preprocessor/PpScanner.cpp" ,
145
+ " glslang/MachineIndependent/preprocessor/PpTokens.cpp" ,
146
+ " glslang/MachineIndependent/preprocessor/PpTokens.h" ,
147
+ " glslang/MachineIndependent/propagateNoContraction.cpp" ,
148
+ " glslang/MachineIndependent/propagateNoContraction.h" ,
149
+ " glslang/MachineIndependent/reflection.cpp" ,
150
+ " glslang/MachineIndependent/reflection.h" ,
151
+ " glslang/OSDependent/osinclude.h" ,
152
+ " glslang/Public/ShaderLang.h" ,
153
+ ]
166
154
167
- defines = [ " ENABLE_OPT=1" ]
155
+ if (! glslang_angle ) {
156
+ sources += [
157
+ " glslang/HLSL/hlslAttributes.cpp" ,
158
+ " glslang/HLSL/hlslAttributes.h" ,
159
+ " glslang/HLSL/hlslGrammar.cpp" ,
160
+ " glslang/HLSL/hlslGrammar.h" ,
161
+ " glslang/HLSL/hlslOpMap.cpp" ,
162
+ " glslang/HLSL/hlslOpMap.h" ,
163
+ " glslang/HLSL/hlslParseables.cpp" ,
164
+ " glslang/HLSL/hlslParseables.h" ,
165
+ " glslang/HLSL/hlslParseHelper.cpp" ,
166
+ " glslang/HLSL/hlslParseHelper.h" ,
167
+ " glslang/HLSL/hlslScanContext.cpp" ,
168
+ " glslang/HLSL/hlslScanContext.h" ,
169
+ " glslang/HLSL/hlslTokens.h" ,
170
+ " glslang/HLSL/hlslTokenStream.cpp" ,
171
+ " glslang/HLSL/hlslTokenStream.h" ,
172
+ ]
173
+ }
168
174
169
- if (is_win ) {
170
- sources += [ " glslang/OSDependent/Windows/ossource.cpp" ]
171
- defines += [ " GLSLANG_OSINCLUDE_WIN32" ]
172
- } else {
173
- sources += [ " glslang/OSDependent/Unix/ossource.cpp" ]
174
- defines += [ " GLSLANG_OSINCLUDE_UNIX" ]
175
- }
175
+ defines = []
176
+ if (invoker .enable_opt ) {
177
+ defines += [ " ENABLE_OPT=1" ]
178
+ }
176
179
177
- if (is_clang ) {
178
- cflags = [
179
- " -Wno-extra-semi" ,
180
- " -Wno-ignored-qualifiers" ,
181
- " -Wno-implicit-fallthrough" ,
182
- " -Wno-inconsistent-missing-override" ,
183
- " -Wno-sign-compare" ,
184
- " -Wno-unused-variable" ,
185
- " -Wno-missing-field-initializers" ,
186
- " -Wno-newline-eof" ,
187
- ]
188
- }
189
- if (is_win && ! is_clang ) {
190
- cflags = [
191
- " /wd4018" , # signed/unsigned mismatch
192
- " /wd4189" , # local variable is initialized but not referenced
193
- ]
180
+ if (is_win ) {
181
+ sources += [ " glslang/OSDependent/Windows/ossource.cpp" ]
182
+ defines += [ " GLSLANG_OSINCLUDE_WIN32" ]
183
+ } else {
184
+ sources += [ " glslang/OSDependent/Unix/ossource.cpp" ]
185
+ defines += [ " GLSLANG_OSINCLUDE_UNIX" ]
186
+ }
187
+
188
+ if (is_clang ) {
189
+ cflags = [
190
+ " -Wno-extra-semi" ,
191
+ " -Wno-ignored-qualifiers" ,
192
+ " -Wno-implicit-fallthrough" ,
193
+ " -Wno-inconsistent-missing-override" ,
194
+ " -Wno-sign-compare" ,
195
+ " -Wno-unused-variable" ,
196
+ " -Wno-missing-field-initializers" ,
197
+ " -Wno-newline-eof" ,
198
+ ]
199
+ }
200
+ if (is_win && ! is_clang ) {
201
+ cflags = [
202
+ " /wd4018" , # signed/unsigned mismatch
203
+ " /wd4189" , # local variable is initialized but not referenced
204
+ ]
205
+ }
206
+
207
+ if (invoker .enable_opt ) {
208
+ deps = [
209
+ " ${ spirv_tools_dir } :spvtools_opt" ,
210
+ " ${ spirv_tools_dir } :spvtools_val"
211
+ ]
212
+ }
213
+
214
+ configs -= _configs_to_remove
215
+ configs += _configs_to_add
194
216
}
217
+ }
195
218
196
- deps = [
197
- " ${ spirv_tools_dir } :spvtools_opt" ,
198
- " ${ spirv_tools_dir } :spvtools_val" ,
199
- ]
219
+ glslang_sources_common (" glslang_sources" ) {
220
+ enable_opt = ! glslang_angle
221
+ }
200
222
201
- configs -= _configs_to_remove
202
- configs += _configs_to_add
223
+ glslang_sources_common ( " glslang_standalone_sources " ) {
224
+ enable_opt = true
203
225
}
204
226
205
227
source_set (" glslang_default_resource_limits_sources" ) {
206
228
sources = [
207
229
" StandAlone/ResourceLimits.cpp" ,
208
230
" StandAlone/ResourceLimits.h" ,
209
231
]
210
- deps = [
211
- " :glslang_sources" ,
212
- ]
213
232
public_configs = [ " :glslang_public" ]
214
233
215
234
configs -= _configs_to_remove
@@ -227,7 +246,7 @@ executable("glslang_validator") {
227
246
defines = [ " ENABLE_OPT=1" ]
228
247
deps = [
229
248
" :glslang_default_resource_limits_sources" ,
230
- " :glslang_sources " ,
249
+ " :glslang_standalone_sources " ,
231
250
]
232
251
233
252
configs -= _configs_to_remove
@@ -240,7 +259,7 @@ executable("spirv-remap") {
240
259
]
241
260
defines = [ " ENABLE_OPT=1" ]
242
261
deps = [
243
- " :glslang_sources " ,
262
+ " :glslang_standalone_sources " ,
244
263
]
245
264
246
265
configs -= _configs_to_remove
0 commit comments