2019-07-29 00:58:32 +02:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
2020-03-30 08:28:32 +02:00
|
|
|
Import("env")
|
|
|
|
Import("env_modules")
|
2019-07-29 00:58:32 +02:00
|
|
|
|
|
|
|
env_glslang = env_modules.Clone()
|
|
|
|
|
|
|
|
# Thirdparty source files
|
2020-03-30 08:28:32 +02:00
|
|
|
if env["builtin_glslang"]:
|
2019-09-27 09:39:53 +02:00
|
|
|
thirdparty_dir = "#thirdparty/glslang/"
|
|
|
|
thirdparty_sources = [
|
2020-10-15 12:04:10 +02:00
|
|
|
"glslang/CInterface/glslang_c_interface.cpp",
|
2019-09-27 09:39:53 +02:00
|
|
|
"glslang/MachineIndependent/RemoveTree.cpp",
|
|
|
|
"glslang/MachineIndependent/ParseHelper.cpp",
|
|
|
|
"glslang/MachineIndependent/iomapper.cpp",
|
|
|
|
"glslang/MachineIndependent/propagateNoContraction.cpp",
|
|
|
|
"glslang/MachineIndependent/Intermediate.cpp",
|
|
|
|
"glslang/MachineIndependent/linkValidate.cpp",
|
|
|
|
"glslang/MachineIndependent/attribute.cpp",
|
|
|
|
"glslang/MachineIndependent/Scan.cpp",
|
|
|
|
"glslang/MachineIndependent/Initialize.cpp",
|
|
|
|
"glslang/MachineIndependent/Constant.cpp",
|
|
|
|
"glslang/MachineIndependent/reflection.cpp",
|
|
|
|
"glslang/MachineIndependent/limits.cpp",
|
|
|
|
"glslang/MachineIndependent/preprocessor/PpScanner.cpp",
|
|
|
|
"glslang/MachineIndependent/preprocessor/PpTokens.cpp",
|
|
|
|
"glslang/MachineIndependent/preprocessor/PpAtom.cpp",
|
|
|
|
"glslang/MachineIndependent/preprocessor/PpContext.cpp",
|
|
|
|
"glslang/MachineIndependent/preprocessor/Pp.cpp",
|
|
|
|
"glslang/MachineIndependent/InfoSink.cpp",
|
|
|
|
"glslang/MachineIndependent/intermOut.cpp",
|
|
|
|
"glslang/MachineIndependent/SymbolTable.cpp",
|
|
|
|
"glslang/MachineIndependent/glslang_tab.cpp",
|
|
|
|
"glslang/MachineIndependent/Versions.cpp",
|
|
|
|
"glslang/MachineIndependent/ShaderLang.cpp",
|
|
|
|
"glslang/MachineIndependent/parseConst.cpp",
|
|
|
|
"glslang/MachineIndependent/PoolAlloc.cpp",
|
|
|
|
"glslang/MachineIndependent/ParseContextBase.cpp",
|
|
|
|
"glslang/MachineIndependent/IntermTraverse.cpp",
|
|
|
|
"glslang/GenericCodeGen/Link.cpp",
|
|
|
|
"glslang/GenericCodeGen/CodeGen.cpp",
|
|
|
|
"OGLCompilersDLL/InitializeDll.cpp",
|
2020-10-15 12:04:10 +02:00
|
|
|
"SPIRV/CInterface/spirv_c_interface.cpp",
|
2019-09-27 09:39:53 +02:00
|
|
|
"SPIRV/InReadableOrder.cpp",
|
|
|
|
"SPIRV/GlslangToSpv.cpp",
|
|
|
|
"SPIRV/SpvBuilder.cpp",
|
|
|
|
"SPIRV/SpvTools.cpp",
|
|
|
|
"SPIRV/disassemble.cpp",
|
|
|
|
"SPIRV/doc.cpp",
|
|
|
|
"SPIRV/SPVRemapper.cpp",
|
|
|
|
"SPIRV/SpvPostProcess.cpp",
|
2020-03-30 08:28:32 +02:00
|
|
|
"SPIRV/Logger.cpp",
|
2020-10-15 12:04:10 +02:00
|
|
|
"StandAlone/ResourceLimits.cpp",
|
2019-09-27 09:39:53 +02:00
|
|
|
]
|
2019-07-29 00:58:32 +02:00
|
|
|
|
2020-03-30 08:28:32 +02:00
|
|
|
if env["platform"] == "windows":
|
2019-09-27 09:39:53 +02:00
|
|
|
thirdparty_sources.append("glslang/OSDependent/Windows/ossource.cpp")
|
|
|
|
else:
|
|
|
|
thirdparty_sources.append("glslang/OSDependent/Unix/ossource.cpp")
|
2019-07-29 00:58:32 +02:00
|
|
|
|
2019-09-27 09:39:53 +02:00
|
|
|
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
|
2019-07-29 00:58:32 +02:00
|
|
|
|
2020-02-18 14:57:11 +01:00
|
|
|
# Treat glslang headers as system headers to avoid raising warnings. Not supported on MSVC.
|
|
|
|
if not env.msvc:
|
2020-03-30 08:28:32 +02:00
|
|
|
env_glslang.Append(CPPFLAGS=["-isystem", Dir(thirdparty_dir).path])
|
2020-02-18 14:57:11 +01:00
|
|
|
else:
|
|
|
|
env_glslang.Prepend(CPPPATH=[thirdparty_dir])
|
2019-09-27 09:39:53 +02:00
|
|
|
|
2020-10-15 12:04:10 +02:00
|
|
|
env_glslang.Append(CPPDEFINES=["ENABLE_OPT=0"])
|
|
|
|
|
2019-09-27 09:39:53 +02:00
|
|
|
env_thirdparty = env_glslang.Clone()
|
|
|
|
env_thirdparty.disable_warnings()
|
|
|
|
env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources)
|
2019-07-29 00:58:32 +02:00
|
|
|
|
|
|
|
# Godot's own source files
|
|
|
|
env_glslang.add_source_files(env.modules_sources, "*.cpp")
|