2020-11-19 02:11:30 +08:00
|
|
|
#!/usr/bin/env python
|
2024-06-12 04:19:07 +08:00
|
|
|
from misc.utility.scons_hints import *
|
2020-11-19 02:11:30 +08:00
|
|
|
|
|
|
|
Import("env")
|
|
|
|
|
2023-09-07 21:54:28 +08:00
|
|
|
if env["platform"] in ["macos", "windows", "linuxbsd"]:
|
2020-11-19 02:11:30 +08:00
|
|
|
# Thirdparty source files
|
|
|
|
thirdparty_dir = "#thirdparty/glad/"
|
2021-11-12 20:49:49 +08:00
|
|
|
thirdparty_sources = ["gl.c"]
|
|
|
|
|
|
|
|
if not env.get("angle_libs"):
|
|
|
|
thirdparty_sources += ["egl.c"]
|
|
|
|
|
2020-11-19 02:11:30 +08:00
|
|
|
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
|
|
|
|
|
2023-05-11 18:32:23 +08: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-19 02:11:30 +08:00
|
|
|
|
|
|
|
env.Append(CPPDEFINES=["GLAD_ENABLED"])
|
2021-11-12 20:49:49 +08:00
|
|
|
env.Append(CPPDEFINES=["EGL_ENABLED"])
|
2020-11-19 02:11:30 +08: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")
|