Build system: add option for MSVC incremental linking.
(cherry picked from commit bbafe14970
)
This commit is contained in:
parent
d3265cf518
commit
cd2e003a05
|
@ -871,6 +871,9 @@ def generate_vs_project(env, num_jobs, project_name="godot"):
|
||||||
if env["precision"] == "double":
|
if env["precision"] == "double":
|
||||||
common_build_postfix.append("precision=double")
|
common_build_postfix.append("precision=double")
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
|
|
@ -185,6 +185,7 @@ def get_opts():
|
||||||
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("debug_crt", "Compile with MSVC's debug CRT (/MDd)", False),
|
BoolVariable("debug_crt", "Compile with MSVC's debug CRT (/MDd)", False),
|
||||||
|
BoolVariable("incremental_link", "Use MSVC incremental linking. May increase or decrease build times.", False),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -355,7 +356,8 @@ def configure_msvc(env, vcvars_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).
|
||||||
|
if not env["incremental_link"]:
|
||||||
env.Append(LINKFLAGS=["/INCREMENTAL:NO"])
|
env.Append(LINKFLAGS=["/INCREMENTAL:NO"])
|
||||||
|
|
||||||
if env["arch"] == "x86_32":
|
if env["arch"] == "x86_32":
|
||||||
|
|
Loading…
Reference in New Issue