2020-11-18 18:11:30 +00:00
|
|
|
#!/usr/bin/env python
|
2024-06-11 20:19:07 +00:00
|
|
|
from misc.utility.scons_hints import *
|
2020-11-18 18:11:30 +00:00
|
|
|
|
|
|
|
Import("env")
|
|
|
|
|
2023-09-07 13:54:28 +00:00
|
|
|
if env["platform"] in ["macos", "windows", "linuxbsd"]:
|
2020-11-18 18:11:30 +00:00
|
|
|
# Thirdparty source files
|
|
|
|
thirdparty_dir = "#thirdparty/glad/"
|
2021-11-12 12:49:49 +00:00
|
|
|
thirdparty_sources = ["gl.c"]
|
|
|
|
|
|
|
|
if not env.get("angle_libs"):
|
|
|
|
thirdparty_sources += ["egl.c"]
|
|
|
|
|
2020-11-18 18:11:30 +00:00
|
|
|
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
|
|
|
|
|
2023-05-11 10:32:23 +00:00
|
|
|
# Treat glad headers as system headers to avoid raising warnings. Not supported on MSVC.
|
|
|
|
if not env.msvc:
|
|
|
|
env.Append(CPPFLAGS=["-isystem", Dir(thirdparty_dir).path])
|
|
|
|
else:
|
|
|
|
env.Prepend(CPPPATH=[thirdparty_dir])
|
2020-11-18 18:11:30 +00:00
|
|
|
|
|
|
|
env.Append(CPPDEFINES=["GLAD_ENABLED"])
|
2021-11-12 12:49:49 +00:00
|
|
|
env.Append(CPPDEFINES=["EGL_ENABLED"])
|
2020-11-18 18:11:30 +00:00
|
|
|
|
|
|
|
env_thirdparty = env.Clone()
|
|
|
|
env_thirdparty.disable_warnings()
|
|
|
|
env_thirdparty.add_source_files(env.drivers_sources, thirdparty_sources)
|
|
|
|
|
|
|
|
# Godot source files
|
|
|
|
env.add_source_files(env.drivers_sources, "*.cpp")
|