Dan Sinclair | 257b25c | 2018-09-24 16:35:44 -0400 | [diff] [blame] | 1 | # 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 | |
| 34 | import("//build_overrides/glslang.gni") |
| 35 | |
David Turner | a3f0da5 | 2019-10-23 16:07:19 +0200 | [diff] [blame] | 36 | # Both Chromium and Fuchsia use by default a set of warning errors |
| 37 | # that is far too strict to compile this project. These are also |
| 38 | # typically appended after |cflags|, overriding target-specific |
| 39 | # definitions. To work around this, determine which configs to |
| 40 | # add and remove in order to succesfully build the project. |
| 41 | if (defined(is_fuchsia_tree) && is_fuchsia_tree) { |
| 42 | _configs_to_remove = [ "//build/config:default_warnings" ] |
| 43 | _configs_to_add = [] |
| 44 | } else { |
| 45 | _configs_to_remove = [ "//build/config/compiler:chromium_code" ] |
| 46 | _configs_to_add = [ "//build/config/compiler:no_chromium_code" ] |
| 47 | } |
| 48 | |
Ben Clayton | fbe9a23 | 2020-06-17 11:17:19 +0100 | [diff] [blame] | 49 | action("glslang_build_info") { |
| 50 | script = "build_info.py" |
| 51 | |
| 52 | src_dir = "." |
| 53 | changes_file = "CHANGES.md" |
| 54 | template_file = "build_info.h.tmpl" |
| 55 | out_file = "${target_gen_dir}/include/glslang/build_info.h" |
| 56 | |
| 57 | inputs = [ |
| 58 | changes_file, |
| 59 | script, |
| 60 | template_file, |
| 61 | ] |
Jamie Madill | bb52b5e | 2020-08-26 00:54:50 -0400 | [diff] [blame] | 62 | outputs = [ out_file ] |
Ben Clayton | fbe9a23 | 2020-06-17 11:17:19 +0100 | [diff] [blame] | 63 | args = [ |
| 64 | rebase_path(src_dir, root_build_dir), |
Jamie Madill | bb52b5e | 2020-08-26 00:54:50 -0400 | [diff] [blame] | 65 | "-i", |
| 66 | rebase_path(template_file, root_build_dir), |
| 67 | "-o", |
| 68 | rebase_path(out_file, root_build_dir), |
Ben Clayton | fbe9a23 | 2020-06-17 11:17:19 +0100 | [diff] [blame] | 69 | ] |
| 70 | } |
| 71 | |
amhagan | 035a3bb | 2021-09-01 11:33:21 -0400 | [diff] [blame] | 72 | action("glslang_extension_headers") { |
| 73 | script = "gen_extension_headers.py" |
| 74 | |
| 75 | out_file = "${target_gen_dir}/include/glslang/glsl_intrinsic_header.h" |
| 76 | |
Yilong Li | 9783380 | 2022-01-01 15:08:35 -0800 | [diff] [blame] | 77 | # Fuchsia GN build rules require all GN actions to be hermetic and they |
| 78 | # should correctly and fully state their inputs and outpus (see |
| 79 | # https://fuchsia.dev/fuchsia-src/development/build/hermetic_actions |
| 80 | # for details). All input files of the script should be added to the |
| 81 | # |sources| list. |
| 82 | sources = [ |
| 83 | "glslang/ExtensionHeaders/GL_EXT_shader_realtime_clock.glsl", |
| 84 | ] |
| 85 | |
amhagan | 035a3bb | 2021-09-01 11:33:21 -0400 | [diff] [blame] | 86 | inputs = [ |
| 87 | script |
| 88 | ] |
| 89 | outputs = [ out_file ] |
| 90 | args = [ |
| 91 | "-i", |
| 92 | rebase_path("glslang/ExtensionHeaders", root_build_dir), |
| 93 | "-o", |
| 94 | rebase_path(out_file, root_build_dir), |
| 95 | ] |
| 96 | } |
| 97 | |
Dan Sinclair | 257b25c | 2018-09-24 16:35:44 -0400 | [diff] [blame] | 98 | spirv_tools_dir = glslang_spirv_tools_dir |
Ryan Harrison | eab46cf | 2020-07-07 11:45:02 -0400 | [diff] [blame] | 99 | if (!defined(glslang_angle)) { |
| 100 | glslang_angle = false |
| 101 | } |
Dan Sinclair | 257b25c | 2018-09-24 16:35:44 -0400 | [diff] [blame] | 102 | |
| 103 | config("glslang_public") { |
| 104 | include_dirs = [ "." ] |
jonahryandavis | 3ce1486 | 2020-10-07 13:32:49 -0400 | [diff] [blame] | 105 | if (!is_win || is_clang) { |
| 106 | cflags = [ "-Wno-conversion" ] |
| 107 | } |
Shahbaz Youssefi | a55029d | 2020-07-05 16:48:34 -0400 | [diff] [blame] | 108 | } |
Corentin Wallez | 9757da4 | 2019-08-26 14:13:54 +0200 | [diff] [blame] | 109 | |
Shahbaz Youssefi | a55029d | 2020-07-05 16:48:34 -0400 | [diff] [blame] | 110 | config("glslang_hlsl") { |
| 111 | defines = [ "ENABLE_HLSL=1" ] |
Dan Sinclair | 257b25c | 2018-09-24 16:35:44 -0400 | [diff] [blame] | 112 | } |
| 113 | |
Shahbaz Youssefi | 8f8f1bc | 2020-07-03 12:34:06 -0400 | [diff] [blame] | 114 | template("glslang_sources_common") { |
| 115 | source_set(target_name) { |
| 116 | public_configs = [ ":glslang_public" ] |
Corentin Wallez | 6857c23 | 2018-10-03 13:15:23 -0400 | [diff] [blame] | 117 | |
Shahbaz Youssefi | a55029d | 2020-07-05 16:48:34 -0400 | [diff] [blame] | 118 | if (invoker.enable_hlsl) { |
| 119 | public_configs += [ ":glslang_hlsl" ] |
| 120 | } |
| 121 | |
Shahbaz Youssefi | 8f8f1bc | 2020-07-03 12:34:06 -0400 | [diff] [blame] | 122 | sources = [ |
| 123 | "OGLCompilersDLL/InitializeDll.cpp", |
| 124 | "OGLCompilersDLL/InitializeDll.h", |
| 125 | "SPIRV/GLSL.ext.AMD.h", |
| 126 | "SPIRV/GLSL.ext.EXT.h", |
| 127 | "SPIRV/GLSL.ext.KHR.h", |
| 128 | "SPIRV/GLSL.ext.NV.h", |
| 129 | "SPIRV/GLSL.std.450.h", |
| 130 | "SPIRV/GlslangToSpv.cpp", |
| 131 | "SPIRV/GlslangToSpv.h", |
| 132 | "SPIRV/InReadableOrder.cpp", |
| 133 | "SPIRV/Logger.cpp", |
| 134 | "SPIRV/Logger.h", |
| 135 | "SPIRV/NonSemanticDebugPrintf.h", |
| 136 | "SPIRV/SPVRemapper.cpp", |
| 137 | "SPIRV/SPVRemapper.h", |
| 138 | "SPIRV/SpvBuilder.cpp", |
| 139 | "SPIRV/SpvBuilder.h", |
| 140 | "SPIRV/SpvPostProcess.cpp", |
Shahbaz Youssefi | 8f8f1bc | 2020-07-03 12:34:06 -0400 | [diff] [blame] | 141 | "SPIRV/SpvTools.h", |
| 142 | "SPIRV/bitutils.h", |
| 143 | "SPIRV/disassemble.cpp", |
| 144 | "SPIRV/disassemble.h", |
| 145 | "SPIRV/doc.cpp", |
| 146 | "SPIRV/doc.h", |
| 147 | "SPIRV/hex_float.h", |
| 148 | "SPIRV/spirv.hpp", |
| 149 | "SPIRV/spvIR.h", |
| 150 | "glslang/GenericCodeGen/CodeGen.cpp", |
| 151 | "glslang/GenericCodeGen/Link.cpp", |
| 152 | "glslang/Include/BaseTypes.h", |
| 153 | "glslang/Include/Common.h", |
| 154 | "glslang/Include/ConstantUnion.h", |
| 155 | "glslang/Include/InfoSink.h", |
| 156 | "glslang/Include/InitializeGlobals.h", |
| 157 | "glslang/Include/PoolAlloc.h", |
| 158 | "glslang/Include/ResourceLimits.h", |
| 159 | "glslang/Include/ShHandle.h", |
Rex Xu | 65a7fb7 | 2021-04-25 16:52:35 +0800 | [diff] [blame] | 160 | "glslang/Include/SpirvIntrinsics.h", |
Shahbaz Youssefi | 8f8f1bc | 2020-07-03 12:34:06 -0400 | [diff] [blame] | 161 | "glslang/Include/Types.h", |
| 162 | "glslang/Include/arrays.h", |
| 163 | "glslang/Include/intermediate.h", |
Shahbaz Youssefi | 8f8f1bc | 2020-07-03 12:34:06 -0400 | [diff] [blame] | 164 | "glslang/MachineIndependent/Constant.cpp", |
| 165 | "glslang/MachineIndependent/InfoSink.cpp", |
| 166 | "glslang/MachineIndependent/Initialize.cpp", |
| 167 | "glslang/MachineIndependent/Initialize.h", |
| 168 | "glslang/MachineIndependent/IntermTraverse.cpp", |
| 169 | "glslang/MachineIndependent/Intermediate.cpp", |
| 170 | "glslang/MachineIndependent/LiveTraverser.h", |
| 171 | "glslang/MachineIndependent/ParseContextBase.cpp", |
| 172 | "glslang/MachineIndependent/ParseHelper.cpp", |
| 173 | "glslang/MachineIndependent/ParseHelper.h", |
| 174 | "glslang/MachineIndependent/PoolAlloc.cpp", |
| 175 | "glslang/MachineIndependent/RemoveTree.cpp", |
| 176 | "glslang/MachineIndependent/RemoveTree.h", |
| 177 | "glslang/MachineIndependent/Scan.cpp", |
| 178 | "glslang/MachineIndependent/Scan.h", |
| 179 | "glslang/MachineIndependent/ScanContext.h", |
| 180 | "glslang/MachineIndependent/ShaderLang.cpp", |
Rex Xu | 65a7fb7 | 2021-04-25 16:52:35 +0800 | [diff] [blame] | 181 | "glslang/MachineIndependent/SpirvIntrinsics.cpp", |
Shahbaz Youssefi | 8f8f1bc | 2020-07-03 12:34:06 -0400 | [diff] [blame] | 182 | "glslang/MachineIndependent/SymbolTable.cpp", |
| 183 | "glslang/MachineIndependent/SymbolTable.h", |
| 184 | "glslang/MachineIndependent/Versions.cpp", |
| 185 | "glslang/MachineIndependent/Versions.h", |
| 186 | "glslang/MachineIndependent/attribute.cpp", |
| 187 | "glslang/MachineIndependent/attribute.h", |
| 188 | "glslang/MachineIndependent/gl_types.h", |
John Kessenich | 4f32f93 | 2020-07-13 03:39:08 -0600 | [diff] [blame] | 189 | "glslang/MachineIndependent/glslang_tab.cpp", |
Shahbaz Youssefi | 8f8f1bc | 2020-07-03 12:34:06 -0400 | [diff] [blame] | 190 | "glslang/MachineIndependent/glslang_tab.cpp.h", |
| 191 | "glslang/MachineIndependent/intermOut.cpp", |
| 192 | "glslang/MachineIndependent/iomapper.cpp", |
| 193 | "glslang/MachineIndependent/iomapper.h", |
| 194 | "glslang/MachineIndependent/limits.cpp", |
| 195 | "glslang/MachineIndependent/linkValidate.cpp", |
| 196 | "glslang/MachineIndependent/localintermediate.h", |
| 197 | "glslang/MachineIndependent/parseConst.cpp", |
| 198 | "glslang/MachineIndependent/parseVersions.h", |
| 199 | "glslang/MachineIndependent/preprocessor/Pp.cpp", |
| 200 | "glslang/MachineIndependent/preprocessor/PpAtom.cpp", |
| 201 | "glslang/MachineIndependent/preprocessor/PpContext.cpp", |
| 202 | "glslang/MachineIndependent/preprocessor/PpContext.h", |
| 203 | "glslang/MachineIndependent/preprocessor/PpScanner.cpp", |
| 204 | "glslang/MachineIndependent/preprocessor/PpTokens.cpp", |
| 205 | "glslang/MachineIndependent/preprocessor/PpTokens.h", |
| 206 | "glslang/MachineIndependent/propagateNoContraction.cpp", |
| 207 | "glslang/MachineIndependent/propagateNoContraction.h", |
| 208 | "glslang/MachineIndependent/reflection.cpp", |
| 209 | "glslang/MachineIndependent/reflection.h", |
| 210 | "glslang/OSDependent/osinclude.h", |
| 211 | "glslang/Public/ShaderLang.h", |
Dan Sinclair | 257b25c | 2018-09-24 16:35:44 -0400 | [diff] [blame] | 212 | ] |
Dan Sinclair | 257b25c | 2018-09-24 16:35:44 -0400 | [diff] [blame] | 213 | |
Shahbaz Youssefi | a55029d | 2020-07-05 16:48:34 -0400 | [diff] [blame] | 214 | # Workaround gn issue complaining about these not being allowed even though GLSLANG_HLSL is not |
| 215 | # defined. |
| 216 | sources += [ |
| 217 | "glslang/HLSL/hlslParseHelper.h", |
| 218 | "glslang/HLSL/hlslParseables.h", |
| 219 | "glslang/HLSL/hlslScanContext.h", |
| 220 | "glslang/HLSL/hlslTokens.h", |
| 221 | ] |
| 222 | |
| 223 | if (invoker.enable_hlsl) { |
Shahbaz Youssefi | 8f8f1bc | 2020-07-03 12:34:06 -0400 | [diff] [blame] | 224 | sources += [ |
| 225 | "glslang/HLSL/hlslAttributes.cpp", |
| 226 | "glslang/HLSL/hlslAttributes.h", |
| 227 | "glslang/HLSL/hlslGrammar.cpp", |
| 228 | "glslang/HLSL/hlslGrammar.h", |
| 229 | "glslang/HLSL/hlslOpMap.cpp", |
| 230 | "glslang/HLSL/hlslOpMap.h", |
Shahbaz Youssefi | 8f8f1bc | 2020-07-03 12:34:06 -0400 | [diff] [blame] | 231 | "glslang/HLSL/hlslParseHelper.cpp", |
Shahbaz Youssefi | a55029d | 2020-07-05 16:48:34 -0400 | [diff] [blame] | 232 | "glslang/HLSL/hlslParseables.cpp", |
Shahbaz Youssefi | 8f8f1bc | 2020-07-03 12:34:06 -0400 | [diff] [blame] | 233 | "glslang/HLSL/hlslScanContext.cpp", |
Shahbaz Youssefi | 8f8f1bc | 2020-07-03 12:34:06 -0400 | [diff] [blame] | 234 | "glslang/HLSL/hlslTokenStream.cpp", |
| 235 | "glslang/HLSL/hlslTokenStream.h", |
| 236 | ] |
| 237 | } |
Ryan Harrison | 1aeceae | 2019-10-15 11:17:53 -0400 | [diff] [blame] | 238 | |
Shahbaz Youssefi | 8f8f1bc | 2020-07-03 12:34:06 -0400 | [diff] [blame] | 239 | defines = [] |
| 240 | if (invoker.enable_opt) { |
Shahbaz Youssefi | 1ef2e25 | 2020-07-03 15:42:53 -0400 | [diff] [blame] | 241 | sources += [ "SPIRV/SpvTools.cpp" ] |
Shahbaz Youssefi | 8f8f1bc | 2020-07-03 12:34:06 -0400 | [diff] [blame] | 242 | defines += [ "ENABLE_OPT=1" ] |
| 243 | } |
Shahbaz Youssefi | 1ef2e25 | 2020-07-03 15:42:53 -0400 | [diff] [blame] | 244 | if (invoker.is_angle) { |
| 245 | defines += [ "GLSLANG_ANGLE" ] |
| 246 | } |
Shahbaz Youssefi | 8f8f1bc | 2020-07-03 12:34:06 -0400 | [diff] [blame] | 247 | |
| 248 | if (is_win) { |
| 249 | sources += [ "glslang/OSDependent/Windows/ossource.cpp" ] |
| 250 | defines += [ "GLSLANG_OSINCLUDE_WIN32" ] |
| 251 | } else { |
| 252 | sources += [ "glslang/OSDependent/Unix/ossource.cpp" ] |
| 253 | defines += [ "GLSLANG_OSINCLUDE_UNIX" ] |
| 254 | } |
| 255 | |
| 256 | if (is_clang) { |
| 257 | cflags = [ |
| 258 | "-Wno-extra-semi", |
| 259 | "-Wno-ignored-qualifiers", |
| 260 | "-Wno-implicit-fallthrough", |
| 261 | "-Wno-inconsistent-missing-override", |
Shahbaz Youssefi | 8f8f1bc | 2020-07-03 12:34:06 -0400 | [diff] [blame] | 262 | "-Wno-missing-field-initializers", |
| 263 | "-Wno-newline-eof", |
Jamie Madill | bb52b5e | 2020-08-26 00:54:50 -0400 | [diff] [blame] | 264 | "-Wno-sign-compare", |
| 265 | "-Wno-suggest-destructor-override", |
| 266 | "-Wno-suggest-override", |
| 267 | "-Wno-unused-variable", |
Shahbaz Youssefi | 8f8f1bc | 2020-07-03 12:34:06 -0400 | [diff] [blame] | 268 | ] |
| 269 | } |
| 270 | if (is_win && !is_clang) { |
| 271 | cflags = [ |
| 272 | "/wd4018", # signed/unsigned mismatch |
| 273 | "/wd4189", # local variable is initialized but not referenced |
| 274 | ] |
| 275 | } |
| 276 | |
pheonix | c897c3b | 2020-11-02 13:40:50 -0800 | [diff] [blame] | 277 | include_dirs = [ "${target_gen_dir}/include" ] |
| 278 | |
Ben Clayton | fbe9a23 | 2020-06-17 11:17:19 +0100 | [diff] [blame] | 279 | deps = [ ":glslang_build_info" ] |
| 280 | |
Shahbaz Youssefi | 8f8f1bc | 2020-07-03 12:34:06 -0400 | [diff] [blame] | 281 | if (invoker.enable_opt) { |
Ben Clayton | fbe9a23 | 2020-06-17 11:17:19 +0100 | [diff] [blame] | 282 | deps += [ |
Shahbaz Youssefi | 8f8f1bc | 2020-07-03 12:34:06 -0400 | [diff] [blame] | 283 | "${spirv_tools_dir}:spvtools_opt", |
Shahbaz Youssefi | a55029d | 2020-07-05 16:48:34 -0400 | [diff] [blame] | 284 | "${spirv_tools_dir}:spvtools_val", |
Shahbaz Youssefi | 8f8f1bc | 2020-07-03 12:34:06 -0400 | [diff] [blame] | 285 | ] |
pheonix | c897c3b | 2020-11-02 13:40:50 -0800 | [diff] [blame] | 286 | include_dirs += [ "${spirv_tools_dir}/include" ] |
Shahbaz Youssefi | 8f8f1bc | 2020-07-03 12:34:06 -0400 | [diff] [blame] | 287 | } |
| 288 | |
| 289 | configs -= _configs_to_remove |
| 290 | configs += _configs_to_add |
| 291 | } |
| 292 | } |
| 293 | |
Shahbaz Youssefi | a55029d | 2020-07-05 16:48:34 -0400 | [diff] [blame] | 294 | glslang_sources_common("glslang_lib_sources") { |
Shahbaz Youssefi | 8f8f1bc | 2020-07-03 12:34:06 -0400 | [diff] [blame] | 295 | enable_opt = !glslang_angle |
Shahbaz Youssefi | a55029d | 2020-07-05 16:48:34 -0400 | [diff] [blame] | 296 | enable_hlsl = !glslang_angle |
Shahbaz Youssefi | 1ef2e25 | 2020-07-03 15:42:53 -0400 | [diff] [blame] | 297 | is_angle = glslang_angle |
Shahbaz Youssefi | 8f8f1bc | 2020-07-03 12:34:06 -0400 | [diff] [blame] | 298 | } |
| 299 | |
Shahbaz Youssefi | a55029d | 2020-07-05 16:48:34 -0400 | [diff] [blame] | 300 | glslang_sources_common("glslang_sources") { |
Shahbaz Youssefi | 8f8f1bc | 2020-07-03 12:34:06 -0400 | [diff] [blame] | 301 | enable_opt = true |
Shahbaz Youssefi | a55029d | 2020-07-05 16:48:34 -0400 | [diff] [blame] | 302 | enable_hlsl = true |
Shahbaz Youssefi | 1ef2e25 | 2020-07-03 15:42:53 -0400 | [diff] [blame] | 303 | is_angle = false |
Dan Sinclair | b29c58e | 2018-09-24 18:40:38 -0400 | [diff] [blame] | 304 | } |
Jamie Madill | 0ceaebc | 2019-01-18 14:53:31 -0500 | [diff] [blame] | 305 | |
| 306 | source_set("glslang_default_resource_limits_sources") { |
| 307 | sources = [ |
| 308 | "StandAlone/ResourceLimits.cpp", |
| 309 | "StandAlone/ResourceLimits.h", |
Shahbaz Youssefi | a55029d | 2020-07-05 16:48:34 -0400 | [diff] [blame] | 310 | "glslang/Include/ResourceLimits.h", |
Jamie Madill | 0ceaebc | 2019-01-18 14:53:31 -0500 | [diff] [blame] | 311 | ] |
Jamie Madill | 0ceaebc | 2019-01-18 14:53:31 -0500 | [diff] [blame] | 312 | public_configs = [ ":glslang_public" ] |
Ryan Harrison | 1aeceae | 2019-10-15 11:17:53 -0400 | [diff] [blame] | 313 | |
David Turner | a3f0da5 | 2019-10-23 16:07:19 +0200 | [diff] [blame] | 314 | configs -= _configs_to_remove |
| 315 | configs += _configs_to_add |
Jamie Madill | 0ceaebc | 2019-01-18 14:53:31 -0500 | [diff] [blame] | 316 | } |
| 317 | |
Jamie Madill | e880e96 | 2019-03-11 15:45:31 -0400 | [diff] [blame] | 318 | executable("glslang_validator") { |
Jamie Madill | 0ceaebc | 2019-01-18 14:53:31 -0500 | [diff] [blame] | 319 | sources = [ |
| 320 | "StandAlone/DirStackFileIncluder.h", |
| 321 | "StandAlone/StandAlone.cpp", |
| 322 | ] |
| 323 | if (!is_win) { |
| 324 | cflags = [ "-Woverflow" ] |
| 325 | } |
Shahbaz Youssefi | 741fc4a | 2019-05-16 23:53:15 -0400 | [diff] [blame] | 326 | defines = [ "ENABLE_OPT=1" ] |
Jamie Madill | 0ceaebc | 2019-01-18 14:53:31 -0500 | [diff] [blame] | 327 | deps = [ |
Jamie Madill | bb52b5e | 2020-08-26 00:54:50 -0400 | [diff] [blame] | 328 | ":glslang_build_info", |
Jamie Madill | 0ceaebc | 2019-01-18 14:53:31 -0500 | [diff] [blame] | 329 | ":glslang_default_resource_limits_sources", |
Shahbaz Youssefi | a55029d | 2020-07-05 16:48:34 -0400 | [diff] [blame] | 330 | ":glslang_sources", |
amhagan | 035a3bb | 2021-09-01 11:33:21 -0400 | [diff] [blame] | 331 | ":glslang_extension_headers", |
Jamie Madill | 0ceaebc | 2019-01-18 14:53:31 -0500 | [diff] [blame] | 332 | ] |
Shahbaz Youssefi | a55029d | 2020-07-05 16:48:34 -0400 | [diff] [blame] | 333 | public_configs = [ ":glslang_hlsl" ] |
Ryan Harrison | 1aeceae | 2019-10-15 11:17:53 -0400 | [diff] [blame] | 334 | |
pheonix | c897c3b | 2020-11-02 13:40:50 -0800 | [diff] [blame] | 335 | include_dirs = [ |
| 336 | "${target_gen_dir}/include", |
| 337 | "${spirv_tools_dir}/include", |
| 338 | ] |
Ben Clayton | fbe9a23 | 2020-06-17 11:17:19 +0100 | [diff] [blame] | 339 | |
David Turner | a3f0da5 | 2019-10-23 16:07:19 +0200 | [diff] [blame] | 340 | configs -= _configs_to_remove |
| 341 | configs += _configs_to_add |
Jamie Madill | 0ceaebc | 2019-01-18 14:53:31 -0500 | [diff] [blame] | 342 | } |
David 'Digit' Turner | 1f5799c | 2019-06-21 14:58:30 +0200 | [diff] [blame] | 343 | |
| 344 | executable("spirv-remap") { |
Shahbaz Youssefi | a55029d | 2020-07-05 16:48:34 -0400 | [diff] [blame] | 345 | sources = [ "StandAlone/spirv-remap.cpp" ] |
David 'Digit' Turner | 1f5799c | 2019-06-21 14:58:30 +0200 | [diff] [blame] | 346 | defines = [ "ENABLE_OPT=1" ] |
Shahbaz Youssefi | a55029d | 2020-07-05 16:48:34 -0400 | [diff] [blame] | 347 | deps = [ ":glslang_sources" ] |
Ryan Harrison | 1aeceae | 2019-10-15 11:17:53 -0400 | [diff] [blame] | 348 | |
Courtney Goeltzenleuchter | d550beb | 2020-11-02 21:22:55 -0700 | [diff] [blame] | 349 | include_dirs = [ "${spirv_tools_dir}/include" ] |
pheonix | c897c3b | 2020-11-02 13:40:50 -0800 | [diff] [blame] | 350 | |
David Turner | a3f0da5 | 2019-10-23 16:07:19 +0200 | [diff] [blame] | 351 | configs -= _configs_to_remove |
| 352 | configs += _configs_to_add |
David 'Digit' Turner | 1f5799c | 2019-06-21 14:58:30 +0200 | [diff] [blame] | 353 | } |