SCsub 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/usr/bin/env python
  2. from misc.utility.scons_hints import *
  3. Import("env")
  4. Import("env_modules")
  5. env_glslang = env_modules.Clone()
  6. # Thirdparty source files
  7. thirdparty_obj = []
  8. if env["builtin_glslang"]:
  9. thirdparty_dir = "#thirdparty/glslang/"
  10. thirdparty_spirv_headers_dir = "#thirdparty/spirv-headers/"
  11. thirdparty_sources = [
  12. "glslang/GenericCodeGen/CodeGen.cpp",
  13. "glslang/GenericCodeGen/Link.cpp",
  14. "glslang/MachineIndependent/attribute.cpp",
  15. "glslang/MachineIndependent/Constant.cpp",
  16. "glslang/MachineIndependent/glslang_tab.cpp",
  17. "glslang/MachineIndependent/InfoSink.cpp",
  18. "glslang/MachineIndependent/Initialize.cpp",
  19. "glslang/MachineIndependent/Intermediate.cpp",
  20. "glslang/MachineIndependent/intermOut.cpp",
  21. "glslang/MachineIndependent/IntermTraverse.cpp",
  22. "glslang/MachineIndependent/iomapper.cpp",
  23. "glslang/MachineIndependent/limits.cpp",
  24. "glslang/MachineIndependent/linkValidate.cpp",
  25. "glslang/MachineIndependent/parseConst.cpp",
  26. "glslang/MachineIndependent/ParseContextBase.cpp",
  27. "glslang/MachineIndependent/ParseHelper.cpp",
  28. "glslang/MachineIndependent/PoolAlloc.cpp",
  29. "glslang/MachineIndependent/preprocessor/PpAtom.cpp",
  30. "glslang/MachineIndependent/preprocessor/PpContext.cpp",
  31. "glslang/MachineIndependent/preprocessor/Pp.cpp",
  32. "glslang/MachineIndependent/preprocessor/PpScanner.cpp",
  33. "glslang/MachineIndependent/preprocessor/PpTokens.cpp",
  34. "glslang/MachineIndependent/propagateNoContraction.cpp",
  35. "glslang/MachineIndependent/reflection.cpp",
  36. "glslang/MachineIndependent/RemoveTree.cpp",
  37. "glslang/MachineIndependent/Scan.cpp",
  38. "glslang/MachineIndependent/ShaderLang.cpp",
  39. "glslang/MachineIndependent/SpirvIntrinsics.cpp",
  40. "glslang/MachineIndependent/SymbolTable.cpp",
  41. "glslang/MachineIndependent/Versions.cpp",
  42. "glslang/ResourceLimits/ResourceLimits.cpp",
  43. "SPIRV/disassemble.cpp",
  44. "SPIRV/doc.cpp",
  45. "SPIRV/GlslangToSpv.cpp",
  46. "SPIRV/InReadableOrder.cpp",
  47. "SPIRV/Logger.cpp",
  48. "SPIRV/SpvBuilder.cpp",
  49. "SPIRV/SpvPostProcess.cpp",
  50. "SPIRV/SPVRemapper.cpp",
  51. "SPIRV/SpvTools.cpp",
  52. ]
  53. if env["platform"] == "windows":
  54. thirdparty_sources.append("glslang/OSDependent/Windows/ossource.cpp")
  55. else:
  56. thirdparty_sources.append("glslang/OSDependent/Unix/ossource.cpp")
  57. thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
  58. env_glslang.Prepend(CPPPATH=[thirdparty_dir, "#thirdparty"])
  59. env_glslang.Prepend(CPPPATH=[thirdparty_spirv_headers_dir + "include/spirv/unified1"])
  60. env_glslang.Append(CPPDEFINES=[("ENABLE_OPT", 0)])
  61. env_thirdparty = env_glslang.Clone()
  62. env_thirdparty.disable_warnings()
  63. env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
  64. env.modules_sources += thirdparty_obj
  65. # Godot source files
  66. module_obj = []
  67. env_glslang.add_source_files(module_obj, "*.cpp")
  68. env.modules_sources += module_obj
  69. # Needed to force rebuilding the module files when the thirdparty library is updated.
  70. env.Depends(module_obj, thirdparty_obj)