mirror of
https://github.com/godotengine/godot.git
synced 2025-10-15 02:49:24 +00:00
Merge pull request #111566 from Repiteo/scons/mingw-big-obj
SCons: Enable MinGW big objects universally
This commit is contained in:
@@ -350,10 +350,7 @@ def configure_msvc(env: "SConsEnvironment"):
|
|||||||
|
|
||||||
env.AppendUnique(CCFLAGS=["/Gd", "/GR", "/nologo"])
|
env.AppendUnique(CCFLAGS=["/Gd", "/GR", "/nologo"])
|
||||||
env.AppendUnique(CCFLAGS=["/utf-8"]) # Force to use Unicode encoding.
|
env.AppendUnique(CCFLAGS=["/utf-8"]) # Force to use Unicode encoding.
|
||||||
# Once it was thought that only debug builds would be too large,
|
env.AppendUnique(CCFLAGS=["/bigobj"]) # Support big objects.
|
||||||
# but this has recently stopped being true. See the mingw function
|
|
||||||
# for notes on why this shouldn't be enabled for gcc
|
|
||||||
env.AppendUnique(CCFLAGS=["/bigobj"])
|
|
||||||
|
|
||||||
env.AppendUnique(
|
env.AppendUnique(
|
||||||
CPPDEFINES=[
|
CPPDEFINES=[
|
||||||
@@ -450,10 +447,6 @@ def configure_msvc(env: "SConsEnvironment"):
|
|||||||
LIBS += ["dxgi", "dxguid"]
|
LIBS += ["dxgi", "dxguid"]
|
||||||
LIBS += ["version"] # Mesa dependency.
|
LIBS += ["version"] # Mesa dependency.
|
||||||
|
|
||||||
# Needed for avoiding C1128.
|
|
||||||
if env["target"] == "release_debug":
|
|
||||||
env.Append(CXXFLAGS=["/bigobj"])
|
|
||||||
|
|
||||||
# PIX
|
# PIX
|
||||||
if env["arch"] not in ["x86_64", "arm64"] or env["pix_path"] == "" or not os.path.exists(env["pix_path"]):
|
if env["arch"] not in ["x86_64", "arm64"] or env["pix_path"] == "" or not os.path.exists(env["pix_path"]):
|
||||||
env["use_pix"] = False
|
env["use_pix"] = False
|
||||||
@@ -637,12 +630,6 @@ def configure_mingw(env: "SConsEnvironment"):
|
|||||||
print("Detected GCC to be a wrapper for Clang.")
|
print("Detected GCC to be a wrapper for Clang.")
|
||||||
env["use_llvm"] = True
|
env["use_llvm"] = True
|
||||||
|
|
||||||
if env.dev_build:
|
|
||||||
# Allow big objects. It's supposed not to have drawbacks but seems to break
|
|
||||||
# GCC LTO, so enabling for debug builds only (which are not built with LTO
|
|
||||||
# and are the only ones with too big objects).
|
|
||||||
env.Append(CCFLAGS=["-Wa,-mbig-obj"])
|
|
||||||
|
|
||||||
if env["windows_subsystem"] == "gui":
|
if env["windows_subsystem"] == "gui":
|
||||||
env.Append(LINKFLAGS=["-Wl,--subsystem,windows"])
|
env.Append(LINKFLAGS=["-Wl,--subsystem,windows"])
|
||||||
else:
|
else:
|
||||||
@@ -660,6 +647,10 @@ def configure_mingw(env: "SConsEnvironment"):
|
|||||||
if env["use_static_cpp"]:
|
if env["use_static_cpp"]:
|
||||||
env.Append(LINKFLAGS=["-static"])
|
env.Append(LINKFLAGS=["-static"])
|
||||||
|
|
||||||
|
# NOTE: Big objects have historically broken LTO on mingw-gcc specifically. While that no
|
||||||
|
# longer appears to be the case, this notice is retained for posterity.
|
||||||
|
env.AppendUnique(CCFLAGS=["-Wa,-mbig-obj"]) # Support big objects.
|
||||||
|
|
||||||
if env["arch"] == "x86_32":
|
if env["arch"] == "x86_32":
|
||||||
env["x86_libtheora_opt_gcc"] = True
|
env["x86_libtheora_opt_gcc"] = True
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user