SCsub 943 B

12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/env python
  2. from misc.utility.scons_hints import *
  3. Import("env")
  4. if env["platform"] in ["macos", "windows", "linuxbsd"]:
  5. # Thirdparty source files
  6. thirdparty_dir = "#thirdparty/glad/"
  7. thirdparty_sources = ["gl.c"]
  8. if not env.get("angle_libs"):
  9. thirdparty_sources += ["egl.c"]
  10. thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
  11. # Treat glad headers as system headers to avoid raising warnings. Not supported on MSVC.
  12. if not env.msvc:
  13. env.Append(CPPFLAGS=["-isystem", Dir(thirdparty_dir).path])
  14. else:
  15. env.Prepend(CPPPATH=[thirdparty_dir])
  16. env.Append(CPPDEFINES=["GLAD_ENABLED"])
  17. env.Append(CPPDEFINES=["EGL_ENABLED"])
  18. env_thirdparty = env.Clone()
  19. env_thirdparty.disable_warnings()
  20. env_thirdparty.add_source_files(env.drivers_sources, thirdparty_sources)
  21. # Godot source files
  22. env.add_source_files(env.drivers_sources, "*.cpp")