blob: 8bead48980e504dc4b6278cea81d6f0a481ba795 [file] [log] [blame]
Dan Sinclair257b25c2018-09-24 16:35:44 -04001# Copyright (C) 2018 Google, Inc.
2#
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions
7# are met:
8#
9# Redistributions of source code must retain the above copyright
10# notice, this list of conditions and the following disclaimer.
11#
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.
16#
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.
20#
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.
33
34import("//build_overrides/glslang.gni")
35
36spirv_tools_dir = glslang_spirv_tools_dir
37
38config("glslang_public") {
39 include_dirs = [ "." ]
40}
41
Dan Sinclairb29c58e2018-09-24 18:40:38 -040042source_set("glslang_sources") {
Dan Sinclair257b25c2018-09-24 16:35:44 -040043 sources = [
44 "OGLCompilersDLL/InitializeDll.cpp",
45 "OGLCompilersDLL/InitializeDll.h",
46 "SPIRV/GLSL.ext.EXT.h",
47 "SPIRV/GLSL.ext.KHR.h",
48 "SPIRV/GLSL.std.450.h",
49 "SPIRV/GlslangToSpv.cpp",
50 "SPIRV/GlslangToSpv.h",
51 "SPIRV/InReadableOrder.cpp",
52 "SPIRV/Logger.cpp",
53 "SPIRV/Logger.h",
54 "SPIRV/SPVRemapper.cpp",
55 "SPIRV/SPVRemapper.h",
56 "SPIRV/SpvBuilder.cpp",
57 "SPIRV/SpvBuilder.h",
58 "SPIRV/bitutils.h",
59 "SPIRV/disassemble.cpp",
60 "SPIRV/disassemble.h",
61 "SPIRV/doc.cpp",
62 "SPIRV/doc.h",
63 "SPIRV/hex_float.h",
64 "SPIRV/spirv.hpp",
65 "SPIRV/spvIR.h",
66 "glslang/GenericCodeGen/CodeGen.cpp",
67 "glslang/GenericCodeGen/Link.cpp",
68 "glslang/Include/BaseTypes.h",
69 "glslang/Include/Common.h",
70 "glslang/Include/ConstantUnion.h",
71 "glslang/Include/InfoSink.h",
72 "glslang/Include/InitializeGlobals.h",
73 "glslang/Include/PoolAlloc.h",
74 "glslang/Include/ResourceLimits.h",
75 "glslang/Include/ShHandle.h",
76 "glslang/Include/Types.h",
77 "glslang/Include/arrays.h",
78 "glslang/Include/intermediate.h",
79 "glslang/Include/revision.h",
80 "glslang/MachineIndependent/Constant.cpp",
81 "glslang/MachineIndependent/InfoSink.cpp",
82 "glslang/MachineIndependent/Initialize.cpp",
83 "glslang/MachineIndependent/Initialize.h",
84 "glslang/MachineIndependent/IntermTraverse.cpp",
85 "glslang/MachineIndependent/Intermediate.cpp",
86 "glslang/MachineIndependent/LiveTraverser.h",
87 "glslang/MachineIndependent/ParseContextBase.cpp",
88 "glslang/MachineIndependent/ParseHelper.cpp",
89 "glslang/MachineIndependent/ParseHelper.h",
90 "glslang/MachineIndependent/PoolAlloc.cpp",
91 "glslang/MachineIndependent/RemoveTree.cpp",
92 "glslang/MachineIndependent/RemoveTree.h",
93 "glslang/MachineIndependent/Scan.cpp",
94 "glslang/MachineIndependent/Scan.h",
95 "glslang/MachineIndependent/ScanContext.h",
96 "glslang/MachineIndependent/ShaderLang.cpp",
97 "glslang/MachineIndependent/SymbolTable.cpp",
98 "glslang/MachineIndependent/SymbolTable.h",
99 "glslang/MachineIndependent/Versions.cpp",
100 "glslang/MachineIndependent/Versions.h",
101 "glslang/MachineIndependent/attribute.cpp",
102 "glslang/MachineIndependent/attribute.h",
103 "glslang/MachineIndependent/gl_types.h",
104 "glslang/MachineIndependent/glslang.y",
105 "glslang/MachineIndependent/glslang_tab.cpp",
106 "glslang/MachineIndependent/glslang_tab.cpp.h",
107 "glslang/MachineIndependent/intermOut.cpp",
108 "glslang/MachineIndependent/iomapper.cpp",
109 "glslang/MachineIndependent/iomapper.h",
110 "glslang/MachineIndependent/limits.cpp",
111 "glslang/MachineIndependent/linkValidate.cpp",
112 "glslang/MachineIndependent/localintermediate.h",
113 "glslang/MachineIndependent/parseConst.cpp",
114 "glslang/MachineIndependent/parseVersions.h",
115 "glslang/MachineIndependent/preprocessor/Pp.cpp",
116 "glslang/MachineIndependent/preprocessor/PpAtom.cpp",
117 "glslang/MachineIndependent/preprocessor/PpContext.cpp",
118 "glslang/MachineIndependent/preprocessor/PpContext.h",
119 "glslang/MachineIndependent/preprocessor/PpScanner.cpp",
120 "glslang/MachineIndependent/preprocessor/PpTokens.cpp",
121 "glslang/MachineIndependent/preprocessor/PpTokens.h",
122 "glslang/MachineIndependent/propagateNoContraction.cpp",
123 "glslang/MachineIndependent/propagateNoContraction.h",
124 "glslang/MachineIndependent/reflection.cpp",
125 "glslang/MachineIndependent/reflection.h",
126 "glslang/OSDependent/osinclude.h",
127 "glslang/Public/ShaderLang.h",
128 ]
129
Dan Sinclairb29c58e2018-09-24 18:40:38 -0400130 defines = []
131 if (is_win) {
132 sources += [ "glslang/OSDependent/Windows/ossource.cpp" ]
133 defines += [ "GLSLANG_OSINCLUDE_WIN32" ]
134 } else {
135 sources += [ "glslang/OSDependent/Unix/ossource.cpp" ]
136 defines += [ "GLSLANG_OSINCLUDE_UNIX" ]
137 }
138
Dan Sinclair257b25c2018-09-24 16:35:44 -0400139 if (is_clang) {
140 cflags_cc = [
141 "-Wno-implicit-fallthrough",
142 "-Wno-ignored-qualifiers",
143 "-Wno-unused-variable",
144 ]
145 }
146
147 deps = [
148 "${spirv_tools_dir}:spvtools_opt",
149 ]
Dan Sinclairb29c58e2018-09-24 18:40:38 -0400150}
Dan Sinclair257b25c2018-09-24 16:35:44 -0400151
Dan Sinclairb29c58e2018-09-24 18:40:38 -0400152static_library("glslang_static") {
153 public_configs = [ ":glslang_public" ]
154
155 deps = [
156 ":glslang_sources",
157 ]
Dan Sinclair257b25c2018-09-24 16:35:44 -0400158
159 configs -= [ "//build/config/compiler:chromium_code" ]
160 configs += [ "//build/config/compiler:no_chromium_code" ]
161}
162