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