SCsub 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/usr/bin/env python
  2. from misc.utility.scons_hints import *
  3. Import("env")
  4. env_effects = env.Clone()
  5. # Thirdparty source files
  6. thirdparty_obj = []
  7. thirdparty_dir = "#thirdparty/amd-fsr2/"
  8. thirdparty_sources = ["ffx_assert.cpp", "ffx_fsr2.cpp"]
  9. thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
  10. env_effects.Prepend(CPPPATH=[thirdparty_dir])
  11. # This flag doesn't actually control anything GCC specific in FSR2. It determines
  12. # if symbols should be exported, which is not required for Godot.
  13. env_effects.Append(CPPDEFINES=["FFX_GCC"])
  14. env_thirdparty = env_effects.Clone()
  15. env_thirdparty.disable_warnings()
  16. env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
  17. env.servers_sources += thirdparty_obj
  18. # Godot source files
  19. module_obj = []
  20. env_effects.add_source_files(module_obj, "*.cpp")
  21. if env["metal"]:
  22. env_effects.add_source_files(module_obj, "metal_fx.mm")
  23. env.servers_sources += module_obj
  24. # Needed to force rebuilding the module files when the thirdparty library is updated.
  25. env.Depends(module_obj, thirdparty_obj)