SCsub 904 B

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