Skip to content

Commit

Permalink
Build system: add option for MSVC incremental linking.
Browse files Browse the repository at this point in the history
  • Loading branch information
anvilfolk committed Aug 29, 2023
1 parent cfe9cd5 commit bbafe14
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,9 @@ def build_commandline(self, commands):
if env["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)])
return result

Expand Down
6 changes: 4 additions & 2 deletions platform/windows/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def get_opts():
BoolVariable("use_static_cpp", "Link MinGW/MSVC C++ runtime libraries statically", True),
BoolVariable("use_asan", "Use address sanitizer (ASAN)", 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),
]


Expand Down Expand Up @@ -355,8 +356,9 @@ def configure_msvc(env, vcvars_msvc_config):
else:
env.AppendUnique(CCFLAGS=["/MD"])

# MSVC incremental linking is broken and _increases_ link time (GH-77968).
env.Append(LINKFLAGS=["/INCREMENTAL:NO"])
# MSVC incremental linking is broken and may _increase_ link time (GH-77968).
if not env["incremental_link"]:
env.Append(LINKFLAGS=["/INCREMENTAL:NO"])

if env["arch"] == "x86_32":
env["x86_libtheora_opt_vc"] = True
Expand Down

0 comments on commit bbafe14

Please sign in to comment.