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 | |
| 36 | spirv_tools_dir = glslang_spirv_tools_dir |
| 37 | |
| 38 | config("glslang_public") { |
| 39 | include_dirs = [ "." ] |
| 40 | } |
| 41 | |
Dan Sinclair | b29c58e | 2018-09-24 18:40:38 -0400 | [diff] [blame] | 42 | source_set("glslang_sources") { |
Corentin Wallez | 6857c23 | 2018-10-03 13:15:23 -0400 | [diff] [blame^] | 43 | public_configs = [ ":glslang_public" ] |
| 44 | |
Dan Sinclair | 257b25c | 2018-09-24 16:35:44 -0400 | [diff] [blame] | 45 | sources = [ |
| 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", |
| 54 | "SPIRV/Logger.cpp", |
| 55 | "SPIRV/Logger.h", |
| 56 | "SPIRV/SPVRemapper.cpp", |
| 57 | "SPIRV/SPVRemapper.h", |
| 58 | "SPIRV/SpvBuilder.cpp", |
| 59 | "SPIRV/SpvBuilder.h", |
Corentin Wallez | 873734d | 2018-09-26 14:51:19 -0700 | [diff] [blame] | 60 | "SPIRV/SpvPostProcess.cpp", |
| 61 | "SPIRV/SpvPostProcess.h", |
Dan Sinclair | 257b25c | 2018-09-24 16:35:44 -0400 | [diff] [blame] | 62 | "SPIRV/bitutils.h", |
| 63 | "SPIRV/disassemble.cpp", |
| 64 | "SPIRV/disassemble.h", |
| 65 | "SPIRV/doc.cpp", |
| 66 | "SPIRV/doc.h", |
| 67 | "SPIRV/hex_float.h", |
| 68 | "SPIRV/spirv.hpp", |
| 69 | "SPIRV/spvIR.h", |
| 70 | "glslang/GenericCodeGen/CodeGen.cpp", |
| 71 | "glslang/GenericCodeGen/Link.cpp", |
| 72 | "glslang/Include/BaseTypes.h", |
| 73 | "glslang/Include/Common.h", |
| 74 | "glslang/Include/ConstantUnion.h", |
| 75 | "glslang/Include/InfoSink.h", |
| 76 | "glslang/Include/InitializeGlobals.h", |
| 77 | "glslang/Include/PoolAlloc.h", |
| 78 | "glslang/Include/ResourceLimits.h", |
| 79 | "glslang/Include/ShHandle.h", |
| 80 | "glslang/Include/Types.h", |
| 81 | "glslang/Include/arrays.h", |
| 82 | "glslang/Include/intermediate.h", |
| 83 | "glslang/Include/revision.h", |
| 84 | "glslang/MachineIndependent/Constant.cpp", |
| 85 | "glslang/MachineIndependent/InfoSink.cpp", |
| 86 | "glslang/MachineIndependent/Initialize.cpp", |
| 87 | "glslang/MachineIndependent/Initialize.h", |
| 88 | "glslang/MachineIndependent/IntermTraverse.cpp", |
| 89 | "glslang/MachineIndependent/Intermediate.cpp", |
| 90 | "glslang/MachineIndependent/LiveTraverser.h", |
| 91 | "glslang/MachineIndependent/ParseContextBase.cpp", |
| 92 | "glslang/MachineIndependent/ParseHelper.cpp", |
| 93 | "glslang/MachineIndependent/ParseHelper.h", |
| 94 | "glslang/MachineIndependent/PoolAlloc.cpp", |
| 95 | "glslang/MachineIndependent/RemoveTree.cpp", |
| 96 | "glslang/MachineIndependent/RemoveTree.h", |
| 97 | "glslang/MachineIndependent/Scan.cpp", |
| 98 | "glslang/MachineIndependent/Scan.h", |
| 99 | "glslang/MachineIndependent/ScanContext.h", |
| 100 | "glslang/MachineIndependent/ShaderLang.cpp", |
| 101 | "glslang/MachineIndependent/SymbolTable.cpp", |
| 102 | "glslang/MachineIndependent/SymbolTable.h", |
| 103 | "glslang/MachineIndependent/Versions.cpp", |
| 104 | "glslang/MachineIndependent/Versions.h", |
| 105 | "glslang/MachineIndependent/attribute.cpp", |
| 106 | "glslang/MachineIndependent/attribute.h", |
| 107 | "glslang/MachineIndependent/gl_types.h", |
| 108 | "glslang/MachineIndependent/glslang.y", |
| 109 | "glslang/MachineIndependent/glslang_tab.cpp", |
| 110 | "glslang/MachineIndependent/glslang_tab.cpp.h", |
| 111 | "glslang/MachineIndependent/intermOut.cpp", |
| 112 | "glslang/MachineIndependent/iomapper.cpp", |
| 113 | "glslang/MachineIndependent/iomapper.h", |
| 114 | "glslang/MachineIndependent/limits.cpp", |
| 115 | "glslang/MachineIndependent/linkValidate.cpp", |
| 116 | "glslang/MachineIndependent/localintermediate.h", |
| 117 | "glslang/MachineIndependent/parseConst.cpp", |
| 118 | "glslang/MachineIndependent/parseVersions.h", |
| 119 | "glslang/MachineIndependent/preprocessor/Pp.cpp", |
| 120 | "glslang/MachineIndependent/preprocessor/PpAtom.cpp", |
| 121 | "glslang/MachineIndependent/preprocessor/PpContext.cpp", |
| 122 | "glslang/MachineIndependent/preprocessor/PpContext.h", |
| 123 | "glslang/MachineIndependent/preprocessor/PpScanner.cpp", |
| 124 | "glslang/MachineIndependent/preprocessor/PpTokens.cpp", |
| 125 | "glslang/MachineIndependent/preprocessor/PpTokens.h", |
| 126 | "glslang/MachineIndependent/propagateNoContraction.cpp", |
| 127 | "glslang/MachineIndependent/propagateNoContraction.h", |
| 128 | "glslang/MachineIndependent/reflection.cpp", |
| 129 | "glslang/MachineIndependent/reflection.h", |
| 130 | "glslang/OSDependent/osinclude.h", |
| 131 | "glslang/Public/ShaderLang.h", |
| 132 | ] |
| 133 | |
Dan Sinclair | b29c58e | 2018-09-24 18:40:38 -0400 | [diff] [blame] | 134 | defines = [] |
| 135 | if (is_win) { |
| 136 | sources += [ "glslang/OSDependent/Windows/ossource.cpp" ] |
| 137 | defines += [ "GLSLANG_OSINCLUDE_WIN32" ] |
| 138 | } else { |
| 139 | sources += [ "glslang/OSDependent/Unix/ossource.cpp" ] |
| 140 | defines += [ "GLSLANG_OSINCLUDE_UNIX" ] |
| 141 | } |
| 142 | |
Dan Sinclair | 257b25c | 2018-09-24 16:35:44 -0400 | [diff] [blame] | 143 | if (is_clang) { |
| 144 | cflags_cc = [ |
| 145 | "-Wno-implicit-fallthrough", |
| 146 | "-Wno-ignored-qualifiers", |
| 147 | "-Wno-unused-variable", |
| 148 | ] |
| 149 | } |
| 150 | |
| 151 | deps = [ |
| 152 | "${spirv_tools_dir}:spvtools_opt", |
| 153 | ] |
Dan Sinclair | b29c58e | 2018-09-24 18:40:38 -0400 | [diff] [blame] | 154 | } |
Dan Sinclair | 257b25c | 2018-09-24 16:35:44 -0400 | [diff] [blame] | 155 | |
Dan Sinclair | b29c58e | 2018-09-24 18:40:38 -0400 | [diff] [blame] | 156 | static_library("glslang_static") { |
Dan Sinclair | b29c58e | 2018-09-24 18:40:38 -0400 | [diff] [blame] | 157 | deps = [ |
| 158 | ":glslang_sources", |
| 159 | ] |
Corentin Wallez | a26827a | 2018-10-02 09:23:08 -0400 | [diff] [blame] | 160 | |
| 161 | # Without this the macOS linker complains that the static library is empty |
| 162 | if (is_mac) { |
| 163 | complete_static_lib = true |
| 164 | } |
Dan Sinclair | 257b25c | 2018-09-24 16:35:44 -0400 | [diff] [blame] | 165 | |
| 166 | configs -= [ "//build/config/compiler:chromium_code" ] |
| 167 | configs += [ "//build/config/compiler:no_chromium_code" ] |
| 168 | } |
| 169 | |