1 # Copyright (C) 2018 Google, Inc.
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions
9 # Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
12 # Redistributions in binary form must reproduce the above
13 # copyright notice, this list of conditions and the following
14 # disclaimer in the documentation and/or other materials provided
15 # with the distribution.
17 # Neither the name of Google Inc. nor the names of its
18 # contributors may be used to endorse or promote products derived
19 # from this software without specific prior written permission.
21 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 # COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 # POSSIBILITY OF SUCH DAMAGE.
34 import("//build_overrides/glslang.gni")
36 spirv_tools_dir = glslang_spirv_tools_dir
38 config("glslang_public") {
39 include_dirs = [ "." ]
42 source_set("glslang_sources") {
43 public_configs = [ ":glslang_public" ]
46 "OGLCompilersDLL/InitializeDll.cpp",
47 "OGLCompilersDLL/InitializeDll.h",
48 "SPIRV/GLSL.ext.EXT.h",
49 "SPIRV/GLSL.ext.KHR.h",
50 "SPIRV/GLSL.std.450.h",
51 "SPIRV/GlslangToSpv.cpp",
52 "SPIRV/GlslangToSpv.h",
53 "SPIRV/InReadableOrder.cpp",
56 "SPIRV/SPVRemapper.cpp",
57 "SPIRV/SPVRemapper.h",
58 "SPIRV/SpvBuilder.cpp",
60 "SPIRV/SpvPostProcess.cpp",
62 "SPIRV/disassemble.cpp",
63 "SPIRV/disassemble.h",
69 "glslang/GenericCodeGen/CodeGen.cpp",
70 "glslang/GenericCodeGen/Link.cpp",
71 "glslang/Include/BaseTypes.h",
72 "glslang/Include/Common.h",
73 "glslang/Include/ConstantUnion.h",
74 "glslang/Include/InfoSink.h",
75 "glslang/Include/InitializeGlobals.h",
76 "glslang/Include/PoolAlloc.h",
77 "glslang/Include/ResourceLimits.h",
78 "glslang/Include/ShHandle.h",
79 "glslang/Include/Types.h",
80 "glslang/Include/arrays.h",
81 "glslang/Include/intermediate.h",
82 "glslang/Include/revision.h",
83 "glslang/MachineIndependent/Constant.cpp",
84 "glslang/MachineIndependent/InfoSink.cpp",
85 "glslang/MachineIndependent/Initialize.cpp",
86 "glslang/MachineIndependent/Initialize.h",
87 "glslang/MachineIndependent/IntermTraverse.cpp",
88 "glslang/MachineIndependent/Intermediate.cpp",
89 "glslang/MachineIndependent/LiveTraverser.h",
90 "glslang/MachineIndependent/ParseContextBase.cpp",
91 "glslang/MachineIndependent/ParseHelper.cpp",
92 "glslang/MachineIndependent/ParseHelper.h",
93 "glslang/MachineIndependent/PoolAlloc.cpp",
94 "glslang/MachineIndependent/RemoveTree.cpp",
95 "glslang/MachineIndependent/RemoveTree.h",
96 "glslang/MachineIndependent/Scan.cpp",
97 "glslang/MachineIndependent/Scan.h",
98 "glslang/MachineIndependent/ScanContext.h",
99 "glslang/MachineIndependent/ShaderLang.cpp",
100 "glslang/MachineIndependent/SymbolTable.cpp",
101 "glslang/MachineIndependent/SymbolTable.h",
102 "glslang/MachineIndependent/Versions.cpp",
103 "glslang/MachineIndependent/Versions.h",
104 "glslang/MachineIndependent/attribute.cpp",
105 "glslang/MachineIndependent/attribute.h",
106 "glslang/MachineIndependent/gl_types.h",
107 "glslang/MachineIndependent/glslang.y",
108 "glslang/MachineIndependent/glslang_tab.cpp",
109 "glslang/MachineIndependent/glslang_tab.cpp.h",
110 "glslang/MachineIndependent/intermOut.cpp",
111 "glslang/MachineIndependent/iomapper.cpp",
112 "glslang/MachineIndependent/iomapper.h",
113 "glslang/MachineIndependent/limits.cpp",
114 "glslang/MachineIndependent/linkValidate.cpp",
115 "glslang/MachineIndependent/localintermediate.h",
116 "glslang/MachineIndependent/parseConst.cpp",
117 "glslang/MachineIndependent/parseVersions.h",
118 "glslang/MachineIndependent/preprocessor/Pp.cpp",
119 "glslang/MachineIndependent/preprocessor/PpAtom.cpp",
120 "glslang/MachineIndependent/preprocessor/PpContext.cpp",
121 "glslang/MachineIndependent/preprocessor/PpContext.h",
122 "glslang/MachineIndependent/preprocessor/PpScanner.cpp",
123 "glslang/MachineIndependent/preprocessor/PpTokens.cpp",
124 "glslang/MachineIndependent/preprocessor/PpTokens.h",
125 "glslang/MachineIndependent/propagateNoContraction.cpp",
126 "glslang/MachineIndependent/propagateNoContraction.h",
127 "glslang/MachineIndependent/reflection.cpp",
128 "glslang/MachineIndependent/reflection.h",
129 "glslang/OSDependent/osinclude.h",
130 "glslang/Public/ShaderLang.h",
135 sources += [ "glslang/OSDependent/Windows/ossource.cpp" ]
136 defines += [ "GLSLANG_OSINCLUDE_WIN32" ]
138 sources += [ "glslang/OSDependent/Unix/ossource.cpp" ]
139 defines += [ "GLSLANG_OSINCLUDE_UNIX" ]
144 "-Wno-ignored-qualifiers",
145 "-Wno-implicit-fallthrough",
146 "-Wno-inconsistent-missing-override",
148 "-Wno-unused-variable",
151 if (is_win && !is_clang) {
153 "/wd4018", # signed/unsigned mismatch
158 "${spirv_tools_dir}:spvtools_opt",
162 source_set("glslang_default_resource_limits_sources") {
164 "StandAlone/ResourceLimits.cpp",
165 "StandAlone/ResourceLimits.h",
167 deps = [ ":glslang_sources" ]
168 public_configs = [ ":glslang_public" ]
171 source_set("glslang_validator") {
173 "StandAlone/DirStackFileIncluder.h",
174 "StandAlone/StandAlone.cpp",
177 cflags = [ "-Woverflow" ]
179 defines = [ "ENABLE_OPT=0" ]
181 ":glslang_default_resource_limits_sources",