2020-03-30 17:23:00 +00:00
|
|
|
# Copyright 2020 Google LLC.
|
|
|
|
#
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
|
|
|
import("//build_overrides/glslang.gni")
|
|
|
|
import("../third_party.gni")
|
|
|
|
|
|
|
|
glslang_root = "../externals/glslang"
|
|
|
|
|
|
|
|
spirv_tools_dir = glslang_spirv_tools_dir
|
|
|
|
|
2020-07-15 18:57:04 +00:00
|
|
|
action("glslang_build_info") {
|
|
|
|
script = "${glslang_root}/build_info.py"
|
|
|
|
|
|
|
|
changes_file = "${glslang_root}/CHANGES.md"
|
|
|
|
template_file = "${glslang_root}/build_info.h.tmpl"
|
|
|
|
out_file = "${target_gen_dir}/include/glslang/build_info.h"
|
|
|
|
|
|
|
|
inputs = [
|
|
|
|
changes_file,
|
|
|
|
script,
|
|
|
|
template_file,
|
|
|
|
]
|
|
|
|
outputs = [ out_file ]
|
|
|
|
args = [
|
|
|
|
rebase_path(glslang_root, root_build_dir),
|
|
|
|
"-i",
|
|
|
|
rebase_path(template_file, root_build_dir),
|
|
|
|
"-o",
|
|
|
|
rebase_path(out_file, root_build_dir),
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2020-03-30 17:23:00 +00:00
|
|
|
third_party("glslang_sources") {
|
|
|
|
public_include_dirs = [ "$glslang_root" ]
|
|
|
|
public_defines = [ "ENABLE_HLSL=1" ]
|
|
|
|
|
|
|
|
sources =
|
|
|
|
rebase_path([
|
|
|
|
"OGLCompilersDLL/InitializeDll.cpp",
|
|
|
|
"OGLCompilersDLL/InitializeDll.h",
|
|
|
|
"SPIRV/GLSL.ext.AMD.h",
|
|
|
|
"SPIRV/GLSL.ext.EXT.h",
|
|
|
|
"SPIRV/GLSL.ext.KHR.h",
|
|
|
|
"SPIRV/GLSL.ext.NV.h",
|
|
|
|
"SPIRV/GLSL.std.450.h",
|
|
|
|
"SPIRV/GlslangToSpv.cpp",
|
|
|
|
"SPIRV/GlslangToSpv.h",
|
|
|
|
"SPIRV/InReadableOrder.cpp",
|
|
|
|
"SPIRV/Logger.cpp",
|
|
|
|
"SPIRV/Logger.h",
|
|
|
|
"SPIRV/NonSemanticDebugPrintf.h",
|
|
|
|
"SPIRV/SPVRemapper.cpp",
|
|
|
|
"SPIRV/SPVRemapper.h",
|
|
|
|
"SPIRV/SpvBuilder.cpp",
|
|
|
|
"SPIRV/SpvBuilder.h",
|
|
|
|
"SPIRV/SpvPostProcess.cpp",
|
|
|
|
"SPIRV/SpvTools.cpp",
|
|
|
|
"SPIRV/SpvTools.h",
|
|
|
|
"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",
|
2020-06-23 04:01:25 +00:00
|
|
|
"glslang/HLSL/hlslAttributes.cpp",
|
|
|
|
"glslang/HLSL/hlslAttributes.h",
|
|
|
|
"glslang/HLSL/hlslGrammar.cpp",
|
|
|
|
"glslang/HLSL/hlslGrammar.h",
|
|
|
|
"glslang/HLSL/hlslOpMap.cpp",
|
|
|
|
"glslang/HLSL/hlslOpMap.h",
|
|
|
|
"glslang/HLSL/hlslParseHelper.cpp",
|
|
|
|
"glslang/HLSL/hlslParseHelper.h",
|
|
|
|
"glslang/HLSL/hlslParseables.cpp",
|
|
|
|
"glslang/HLSL/hlslParseables.h",
|
|
|
|
"glslang/HLSL/hlslScanContext.cpp",
|
|
|
|
"glslang/HLSL/hlslScanContext.h",
|
|
|
|
"glslang/HLSL/hlslTokenStream.cpp",
|
|
|
|
"glslang/HLSL/hlslTokenStream.h",
|
|
|
|
"glslang/HLSL/hlslTokens.h",
|
2020-03-30 17:23:00 +00:00
|
|
|
"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/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",
|
|
|
|
],
|
|
|
|
".",
|
|
|
|
"$glslang_root")
|
|
|
|
|
|
|
|
defines = [ "ENABLE_OPT=1" ]
|
|
|
|
|
|
|
|
if (is_win) {
|
|
|
|
sources += [ "${glslang_root}/glslang/OSDependent/Windows/ossource.cpp" ]
|
|
|
|
defines += [ "GLSLANG_OSINCLUDE_WIN32" ]
|
|
|
|
} else {
|
|
|
|
sources += [ "${glslang_root}/glslang/OSDependent/Unix/ossource.cpp" ]
|
|
|
|
defines += [ "GLSLANG_OSINCLUDE_UNIX" ]
|
|
|
|
}
|
|
|
|
|
2020-07-15 18:57:04 +00:00
|
|
|
include_dirs = [ "${target_gen_dir}/include" ]
|
|
|
|
deps = [
|
|
|
|
":glslang_build_info",
|
|
|
|
"${spirv_tools_dir}:spvtools_val",
|
|
|
|
]
|
2020-03-30 17:23:00 +00:00
|
|
|
}
|