You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-16 14:00:40 +00:00
Build system: add option for MSVC incremental linking.
(cherry picked from commit bbafe14970)
This commit is contained in:
committed by
Rémi Verschelde
parent
2ce2f632f0
commit
5013dde8fc
@@ -787,6 +787,9 @@ def generate_vs_project(env, num_jobs):
|
|||||||
if env["custom_modules"]:
|
if env["custom_modules"]:
|
||||||
common_build_postfix.append("custom_modules=%s" % env["custom_modules"])
|
common_build_postfix.append("custom_modules=%s" % env["custom_modules"])
|
||||||
|
|
||||||
|
if env["incremental_link"]:
|
||||||
|
common_build_postfix.append("incremental_link=yes")
|
||||||
|
|
||||||
result = " ^& ".join(common_build_prefix + [" ".join([commands] + common_build_postfix)])
|
result = " ^& ".join(common_build_prefix + [" ".join([commands] + common_build_postfix)])
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ def get_opts():
|
|||||||
BoolVariable("use_thinlto", "Use ThinLTO", False),
|
BoolVariable("use_thinlto", "Use ThinLTO", False),
|
||||||
BoolVariable("use_static_cpp", "Link MinGW/MSVC C++ runtime libraries statically", True),
|
BoolVariable("use_static_cpp", "Link MinGW/MSVC C++ runtime libraries statically", True),
|
||||||
BoolVariable("use_asan", "Use address sanitizer (ASAN)", False),
|
BoolVariable("use_asan", "Use address sanitizer (ASAN)", False),
|
||||||
|
BoolVariable("incremental_link", "Use MSVC incremental linking. May increase or decrease build times.", False),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@@ -216,8 +217,9 @@ def configure_msvc(env, manual_msvc_config):
|
|||||||
else:
|
else:
|
||||||
env.AppendUnique(CCFLAGS=["/MD"])
|
env.AppendUnique(CCFLAGS=["/MD"])
|
||||||
|
|
||||||
# MSVC incremental linking is broken and _increases_ link time (GH-77968).
|
# MSVC incremental linking is broken and may _increase_ link time (GH-77968).
|
||||||
env.Append(LINKFLAGS=["/INCREMENTAL:NO"])
|
if not env["incremental_link"]:
|
||||||
|
env.Append(LINKFLAGS=["/INCREMENTAL:NO"])
|
||||||
|
|
||||||
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.
|
||||||
|
|||||||
Reference in New Issue
Block a user