mirror of
https://github.com/godotengine/godot-cpp.git
synced 2026-01-03 18:09:13 +03:00
Merge pull request #1756 from Repiteo/scons/external-includes
SCons: Add `CPPEXTPATH` for external includes
This commit is contained in:
@@ -2,6 +2,7 @@ import os
|
|||||||
import platform
|
import platform
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from SCons import __version__ as scons_raw_version
|
||||||
from SCons.Action import Action
|
from SCons.Action import Action
|
||||||
from SCons.Builder import Builder
|
from SCons.Builder import Builder
|
||||||
from SCons.Errors import UserError
|
from SCons.Errors import UserError
|
||||||
@@ -380,6 +381,8 @@ def options(opts, env):
|
|||||||
|
|
||||||
|
|
||||||
def generate(env):
|
def generate(env):
|
||||||
|
env.scons_version = env._get_major_minor_revision(scons_raw_version)
|
||||||
|
|
||||||
# Default num_jobs to local cpu count if not user specified.
|
# Default num_jobs to local cpu count if not user specified.
|
||||||
# SCons has a peculiarity where user-specified options won't be overridden
|
# SCons has a peculiarity where user-specified options won't be overridden
|
||||||
# by SetOption, so we can rely on this to know if we should use our default.
|
# by SetOption, so we can rely on this to know if we should use our default.
|
||||||
@@ -437,6 +440,17 @@ def generate(env):
|
|||||||
else: # Release
|
else: # Release
|
||||||
opt_level = "speed"
|
opt_level = "speed"
|
||||||
|
|
||||||
|
# Allow marking includes as external/system to avoid raising warnings.
|
||||||
|
if env.scons_version < (4, 2):
|
||||||
|
env["_CPPEXTINCFLAGS"] = "${_concat(EXTINCPREFIX, CPPEXTPATH, EXTINCSUFFIX, __env__, RDirs, TARGET, SOURCE)}"
|
||||||
|
else:
|
||||||
|
env["_CPPEXTINCFLAGS"] = (
|
||||||
|
"${_concat(EXTINCPREFIX, CPPEXTPATH, EXTINCSUFFIX, __env__, RDirs, TARGET, SOURCE, affect_signature=False)}"
|
||||||
|
)
|
||||||
|
env["CPPEXTPATH"] = []
|
||||||
|
env["EXTINCPREFIX"] = "-isystem "
|
||||||
|
env["EXTINCSUFFIX"] = ""
|
||||||
|
|
||||||
env["optimize"] = ARGUMENTS.get("optimize", opt_level)
|
env["optimize"] = ARGUMENTS.get("optimize", opt_level)
|
||||||
env["debug_symbols"] = get_cmdline_bool("debug_symbols", env.dev_build)
|
env["debug_symbols"] = get_cmdline_bool("debug_symbols", env.dev_build)
|
||||||
|
|
||||||
|
|||||||
@@ -130,6 +130,11 @@ def generate(env):
|
|||||||
if env["silence_msvc"] and not env.GetOption("clean"):
|
if env["silence_msvc"] and not env.GetOption("clean"):
|
||||||
silence_msvc(env)
|
silence_msvc(env)
|
||||||
|
|
||||||
|
if not env["use_llvm"]:
|
||||||
|
env.AppendUnique(CCFLAGS=["/experimental:external", "/external:anglebrackets"])
|
||||||
|
env.AppendUnique(CCFLAGS=["/external:W0"])
|
||||||
|
env["EXTINCPREFIX"] = "/external:I"
|
||||||
|
|
||||||
elif (sys.platform == "win32" or sys.platform == "msys") and not env["mingw_prefix"]:
|
elif (sys.platform == "win32" or sys.platform == "msys") and not env["mingw_prefix"]:
|
||||||
env["use_mingw"] = True
|
env["use_mingw"] = True
|
||||||
mingw.generate(env)
|
mingw.generate(env)
|
||||||
|
|||||||
Reference in New Issue
Block a user