SCsub 878 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/env python
  2. Import("env")
  3. thirdparty_obj = []
  4. if env["platform"] in ["haiku", "osx", "windows", "x11"]:
  5. # Thirdparty source files
  6. thirdparty_dir = "#thirdparty/glad/"
  7. thirdparty_sources = [
  8. "glad.c",
  9. ]
  10. thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
  11. env.Prepend(CPPPATH=[thirdparty_dir])
  12. env.Append(CPPDEFINES=["GLAD_ENABLED"])
  13. env.Append(CPPDEFINES=["GLES_OVER_GL"])
  14. env_thirdparty = env.Clone()
  15. env_thirdparty.disable_warnings()
  16. env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
  17. env.drivers_sources += thirdparty_obj
  18. # Godot source files
  19. driver_obj = []
  20. env.add_source_files(driver_obj, "*.cpp")
  21. env.drivers_sources += driver_obj
  22. # Needed to force rebuilding the driver files when the thirdparty code is updated.
  23. env.Depends(driver_obj, thirdparty_obj)