Disable incremental linking on MSVC #11552
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Incremental linking does not make sense for temporary executables (
crystal eval
,run
,spec
,play
, specs that invoke the compiler program), because a full link is performed if the output is missing, and Crystal always deletes those executables after finishing; all we get is a padded executable, an .ilk file that never gets used, and this warning message:Even for
crystal build
, MSVC performs a full link whenever the link command line changes. The way Crystal programs are written can cause frequent changes to the command line, so incremental linking is now disabled by default. It can still be explicitly enabled with--link=flags=/INCREMENTAL
(MSVC generates no warnings if multiple conflicting/INCREMENTAL
options are specified, the last one takes effect).