2018-09-24 20:35:44 +00:00
|
|
|
# Copyright (C) 2018 Google, Inc.
|
|
|
|
#
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions
|
|
|
|
# are met:
|
|
|
|
#
|
|
|
|
# Redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
#
|
|
|
|
# Redistributions in binary form must reproduce the above
|
|
|
|
# copyright notice, this list of conditions and the following
|
|
|
|
# disclaimer in the documentation and/or other materials provided
|
|
|
|
# with the distribution.
|
|
|
|
#
|
|
|
|
# Neither the name of Google Inc. nor the names of its
|
|
|
|
# contributors may be used to endorse or promote products derived
|
|
|
|
# from this software without specific prior written permission.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
|
# COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
|
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
|
|
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
|
|
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
# POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
import("//build_overrides/glslang.gni")
|
|
|
|
|
|
|
|
spirv_tools_dir = glslang_spirv_tools_dir
|
|
|
|
|
|
|
|
config("glslang_public") {
|
|
|
|
include_dirs = [ "." ]
|
2019-08-26 12:13:54 +00:00
|
|
|
|
|
|
|
defines = [ "ENABLE_HLSL=1" ]
|
2018-09-24 20:35:44 +00:00
|
|
|
}
|
|
|
|
|
2018-09-24 22:40:38 +00:00
|
|
|
source_set("glslang_sources") {
|
2018-10-03 17:15:23 +00:00
|
|
|
public_configs = [ ":glslang_public" ]
|
|
|
|
|
2018-09-24 20:35:44 +00:00
|
|
|
sources = [
|
|
|
|
"OGLCompilersDLL/InitializeDll.cpp",
|
|
|
|
"OGLCompilersDLL/InitializeDll.h",
|
|
|
|
"SPIRV/GLSL.ext.EXT.h",
|
|
|
|
"SPIRV/GLSL.ext.KHR.h",
|
|
|
|
"SPIRV/GLSL.std.450.h",
|
|
|
|
"SPIRV/GlslangToSpv.cpp",
|
|
|
|
"SPIRV/GlslangToSpv.h",
|
|
|
|
"SPIRV/InReadableOrder.cpp",
|
|
|
|
"SPIRV/Logger.cpp",
|
|
|
|
"SPIRV/Logger.h",
|
|
|
|
"SPIRV/SPVRemapper.cpp",
|
|
|
|
"SPIRV/SPVRemapper.h",
|
|
|
|
"SPIRV/SpvBuilder.cpp",
|
|
|
|
"SPIRV/SpvBuilder.h",
|
2018-09-26 21:51:19 +00:00
|
|
|
"SPIRV/SpvPostProcess.cpp",
|
2019-05-17 03:53:15 +00:00
|
|
|
"SPIRV/SpvTools.cpp",
|
|
|
|
"SPIRV/SpvTools.h",
|
2018-09-24 20:35:44 +00:00
|
|
|
"SPIRV/bitutils.h",
|
|
|
|
"SPIRV/disassemble.cpp",
|
|
|
|
"SPIRV/disassemble.h",
|
|
|
|
"SPIRV/doc.cpp",
|
|
|
|
"SPIRV/doc.h",
|
|
|
|
"SPIRV/hex_float.h",
|
|
|
|
"SPIRV/spirv.hpp",
|
|
|
|
"SPIRV/spvIR.h",
|
|
|
|
"glslang/GenericCodeGen/CodeGen.cpp",
|
|
|
|
"glslang/GenericCodeGen/Link.cpp",
|
|
|
|
"glslang/Include/BaseTypes.h",
|
|
|
|
"glslang/Include/Common.h",
|
|
|
|
"glslang/Include/ConstantUnion.h",
|
|
|
|
"glslang/Include/InfoSink.h",
|
|
|
|
"glslang/Include/InitializeGlobals.h",
|
|
|
|
"glslang/Include/PoolAlloc.h",
|
|
|
|
"glslang/Include/ResourceLimits.h",
|
|
|
|
"glslang/Include/ShHandle.h",
|
|
|
|
"glslang/Include/Types.h",
|
|
|
|
"glslang/Include/arrays.h",
|
|
|
|
"glslang/Include/intermediate.h",
|
|
|
|
"glslang/Include/revision.h",
|
|
|
|
"glslang/MachineIndependent/Constant.cpp",
|
|
|
|
"glslang/MachineIndependent/InfoSink.cpp",
|
|
|
|
"glslang/MachineIndependent/Initialize.cpp",
|
|
|
|
"glslang/MachineIndependent/Initialize.h",
|
|
|
|
"glslang/MachineIndependent/IntermTraverse.cpp",
|
|
|
|
"glslang/MachineIndependent/Intermediate.cpp",
|
|
|
|
"glslang/MachineIndependent/LiveTraverser.h",
|
|
|
|
"glslang/MachineIndependent/ParseContextBase.cpp",
|
|
|
|
"glslang/MachineIndependent/ParseHelper.cpp",
|
|
|
|
"glslang/MachineIndependent/ParseHelper.h",
|
|
|
|
"glslang/MachineIndependent/PoolAlloc.cpp",
|
|
|
|
"glslang/MachineIndependent/RemoveTree.cpp",
|
|
|
|
"glslang/MachineIndependent/RemoveTree.h",
|
|
|
|
"glslang/MachineIndependent/Scan.cpp",
|
|
|
|
"glslang/MachineIndependent/Scan.h",
|
|
|
|
"glslang/MachineIndependent/ScanContext.h",
|
|
|
|
"glslang/MachineIndependent/ShaderLang.cpp",
|
|
|
|
"glslang/MachineIndependent/SymbolTable.cpp",
|
|
|
|
"glslang/MachineIndependent/SymbolTable.h",
|
|
|
|
"glslang/MachineIndependent/Versions.cpp",
|
|
|
|
"glslang/MachineIndependent/Versions.h",
|
|
|
|
"glslang/MachineIndependent/attribute.cpp",
|
|
|
|
"glslang/MachineIndependent/attribute.h",
|
|
|
|
"glslang/MachineIndependent/gl_types.h",
|
|
|
|
"glslang/MachineIndependent/glslang_tab.cpp",
|
|
|
|
"glslang/MachineIndependent/glslang_tab.cpp.h",
|
|
|
|
"glslang/MachineIndependent/intermOut.cpp",
|
|
|
|
"glslang/MachineIndependent/iomapper.cpp",
|
|
|
|
"glslang/MachineIndependent/iomapper.h",
|
|
|
|
"glslang/MachineIndependent/limits.cpp",
|
|
|
|
"glslang/MachineIndependent/linkValidate.cpp",
|
|
|
|
"glslang/MachineIndependent/localintermediate.h",
|
|
|
|
"glslang/MachineIndependent/parseConst.cpp",
|
|
|
|
"glslang/MachineIndependent/parseVersions.h",
|
|
|
|
"glslang/MachineIndependent/preprocessor/Pp.cpp",
|
|
|
|
"glslang/MachineIndependent/preprocessor/PpAtom.cpp",
|
|
|
|
"glslang/MachineIndependent/preprocessor/PpContext.cpp",
|
|
|
|
"glslang/MachineIndependent/preprocessor/PpContext.h",
|
|
|
|
"glslang/MachineIndependent/preprocessor/PpScanner.cpp",
|
|
|
|
"glslang/MachineIndependent/preprocessor/PpTokens.cpp",
|
|
|
|
"glslang/MachineIndependent/preprocessor/PpTokens.h",
|
|
|
|
"glslang/MachineIndependent/propagateNoContraction.cpp",
|
|
|
|
"glslang/MachineIndependent/propagateNoContraction.h",
|
|
|
|
"glslang/MachineIndependent/reflection.cpp",
|
|
|
|
"glslang/MachineIndependent/reflection.h",
|
|
|
|
"glslang/OSDependent/osinclude.h",
|
|
|
|
"glslang/Public/ShaderLang.h",
|
2019-08-27 13:24:31 +00:00
|
|
|
"hlsl/hlslAttributes.cpp",
|
|
|
|
"hlsl/hlslAttributes.h",
|
|
|
|
"hlsl/hlslGrammar.cpp",
|
|
|
|
"hlsl/hlslGrammar.h",
|
|
|
|
"hlsl/hlslOpMap.cpp",
|
|
|
|
"hlsl/hlslOpMap.h",
|
|
|
|
"hlsl/hlslParseHelper.cpp",
|
|
|
|
"hlsl/hlslParseHelper.h",
|
|
|
|
"hlsl/hlslParseables.cpp",
|
|
|
|
"hlsl/hlslParseables.h",
|
|
|
|
"hlsl/hlslScanContext.cpp",
|
|
|
|
"hlsl/hlslScanContext.h",
|
|
|
|
"hlsl/hlslTokenStream.cpp",
|
|
|
|
"hlsl/hlslTokenStream.h",
|
|
|
|
"hlsl/hlslTokens.h",
|
2018-09-24 20:35:44 +00:00
|
|
|
]
|
|
|
|
|
2019-08-26 12:13:54 +00:00
|
|
|
defines = [ "ENABLE_OPT=1" ]
|
2019-08-23 18:34:29 +00:00
|
|
|
|
2018-09-24 22:40:38 +00:00
|
|
|
if (is_win) {
|
|
|
|
sources += [ "glslang/OSDependent/Windows/ossource.cpp" ]
|
|
|
|
defines += [ "GLSLANG_OSINCLUDE_WIN32" ]
|
|
|
|
} else {
|
|
|
|
sources += [ "glslang/OSDependent/Unix/ossource.cpp" ]
|
|
|
|
defines += [ "GLSLANG_OSINCLUDE_UNIX" ]
|
|
|
|
}
|
|
|
|
|
2018-09-24 20:35:44 +00:00
|
|
|
if (is_clang) {
|
|
|
|
cflags_cc = [
|
2019-01-30 16:37:15 +00:00
|
|
|
"-Wno-extra-semi",
|
2018-09-24 20:35:44 +00:00
|
|
|
"-Wno-ignored-qualifiers",
|
2019-01-18 19:53:31 +00:00
|
|
|
"-Wno-implicit-fallthrough",
|
2019-01-23 23:56:43 +00:00
|
|
|
"-Wno-inconsistent-missing-override",
|
2019-01-18 19:53:31 +00:00
|
|
|
"-Wno-sign-compare",
|
2018-09-24 20:35:44 +00:00
|
|
|
"-Wno-unused-variable",
|
2019-06-21 12:58:30 +00:00
|
|
|
"-Wno-missing-field-initializers",
|
2019-09-16 17:13:16 +00:00
|
|
|
"-Wno-newline-eof",
|
2019-10-11 15:00:57 +00:00
|
|
|
"-Wextra-semi",
|
2018-09-24 20:35:44 +00:00
|
|
|
]
|
|
|
|
}
|
2019-01-24 15:55:41 +00:00
|
|
|
if (is_win && !is_clang) {
|
|
|
|
cflags = [
|
2019-08-26 12:13:54 +00:00
|
|
|
"/wd4018", # signed/unsigned mismatch
|
|
|
|
"/wd4189", # local variable is initialized but not referenced
|
2019-01-24 15:55:41 +00:00
|
|
|
]
|
|
|
|
}
|
2018-09-24 20:35:44 +00:00
|
|
|
|
|
|
|
deps = [
|
|
|
|
"${spirv_tools_dir}:spvtools_opt",
|
2019-05-17 03:53:15 +00:00
|
|
|
"${spirv_tools_dir}:spvtools_val",
|
2018-09-24 20:35:44 +00:00
|
|
|
]
|
2018-09-24 22:40:38 +00:00
|
|
|
}
|
2019-01-18 19:53:31 +00:00
|
|
|
|
|
|
|
source_set("glslang_default_resource_limits_sources") {
|
|
|
|
sources = [
|
|
|
|
"StandAlone/ResourceLimits.cpp",
|
|
|
|
"StandAlone/ResourceLimits.h",
|
|
|
|
]
|
2019-08-26 12:13:54 +00:00
|
|
|
deps = [
|
|
|
|
":glslang_sources",
|
|
|
|
]
|
2019-01-18 19:53:31 +00:00
|
|
|
public_configs = [ ":glslang_public" ]
|
|
|
|
}
|
|
|
|
|
2019-03-11 19:45:31 +00:00
|
|
|
executable("glslang_validator") {
|
2019-01-18 19:53:31 +00:00
|
|
|
sources = [
|
|
|
|
"StandAlone/DirStackFileIncluder.h",
|
|
|
|
"StandAlone/StandAlone.cpp",
|
|
|
|
]
|
|
|
|
if (!is_win) {
|
|
|
|
cflags = [ "-Woverflow" ]
|
|
|
|
}
|
2019-05-17 03:53:15 +00:00
|
|
|
defines = [ "ENABLE_OPT=1" ]
|
2019-01-18 19:53:31 +00:00
|
|
|
deps = [
|
|
|
|
":glslang_default_resource_limits_sources",
|
|
|
|
":glslang_sources",
|
|
|
|
]
|
|
|
|
}
|
2019-06-21 12:58:30 +00:00
|
|
|
|
|
|
|
executable("spirv-remap") {
|
|
|
|
sources = [
|
|
|
|
"StandAlone/spirv-remap.cpp",
|
|
|
|
]
|
|
|
|
defines = [ "ENABLE_OPT=1" ]
|
|
|
|
deps = [
|
|
|
|
":glslang_sources",
|
|
|
|
]
|
|
|
|
}
|