0.2.0-dev Download ZIP
28 lines ·868 B Raw
| 1 | #!/usr/bin/env python |
| 2 | from misc.utility.scons_hints import * |
| 3 | |
| 4 | Import("env") |
| 5 | |
| 6 | if env["platform"] in ["macos", "windows", "linuxbsd"]: |
| 7 | # Thirdparty source files |
| 8 | thirdparty_dir = "#thirdparty/glad/" |
| 9 | thirdparty_sources = ["gl.c"] |
| 10 | |
| 11 | env.Prepend(CPPPATH=[thirdparty_dir]) |
| 12 | |
| 13 | env.Append(CPPDEFINES=["GLAD_ENABLED"]) |
| 14 | if env["platform"] == "linuxbsd": |
| 15 | thirdparty_sources += ["egl.c"] |
| 16 | env.Append(CPPDEFINES=["EGL_ENABLED", "GLAD_GLES2"]) |
| 17 | else: |
| 18 | if env["angle"]: |
| 19 | env.Append(CPPDEFINES=["EGL_ENABLED", "GLAD_GLES2"]) |
| 20 | |
| 21 | thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] |
| 22 | |
| 23 | env_thirdparty = env.Clone() |
| 24 | env_thirdparty.disable_warnings() |
| 25 | env_thirdparty.add_source_files(env.drivers_sources, thirdparty_sources) |
| 26 | |
| 27 | # Godot source files |
| 28 | env.add_source_files(env.drivers_sources, "*.cpp") |