Skip to content

cmake: silence MSVC linker warning in debug builds with CURL_DROP_UNUSED=ON - #23435

Closed
vszakats wants to merge 4 commits into
curl:masterfrom
vszakats:cm-silence-msvc-dbg-linker-warning
Closed

vszakats wants to merge 4 commits into
curl:masterfrom
vszakats:cm-silence-msvc-dbg-linker-warning

Conversation

@vszakats

@vszakats vszakats commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

This option is not typically meant for debug builds (one reason is that
it disables incremental builds), but if used anyway, silence the
warnings for cleaner logs in such jobs.

E.g. VS2013, VS2019 Debug in CI:

LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:REF' specification

Ref: https://ci.appveyor.com/project/curlorg/curl/builds/54910213/job/tf9p0r9eijgxqyof#L208
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/54910213/job/x650jultxsd137eo#L209

clang-cl VS2026 Debug:

lld-link : warning : ignoring '/incremental' because REF is enabled; use '/opt:noref' to disable

Ref: https://ci.appveyor.com/project/curlorg/curl/builds/54910213/job/3si68rb0oof2ksmf#L220

Also:

  • GHA/windows: drop redundant manual linker flags from MSVC jobs.
    • -OPT:NOICF is the default for Debug builds.
    • -OPT:NOREF conflicts with CURL_DROP_UNUSED=ON.
    • -INCREMENTAL:NO is set via CURL_DROP_UNUSED=ON after this patch,
      implied before.

Refs:
https://cmake.org/cmake/help/v3.19/manual/cmake-generator-expressions.7.html
https://cmake.org/cmake/help/v3.18/manual/cmake-generator-expressions.7.html
https://learn.microsoft.com/cpp/build/reference/opt-optimizations

Follow-up to 66ad54e #20357
Follow-up to a72b479 #15657

…USED=ON`

This option is not typically meant for debug builds (one reason is that
it disables incremental builds), but if used anyway, lets silence the
warnings for cleaner logs in such jobs.

E.g. VS2013, VS2019 Debug in CI:
```
LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/OPT:REF' specificatio
```
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/54910213/job/tf9p0r9eijgxqyof#L208
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/54910213/job/x650jultxsd137eo#L209

clang-cl VS2026 Debug:
```
lld-link : warning : ignoring '/incremental' because REF is enabled; use '/opt:noref' to disable
```
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/54910213/job/3si68rb0oof2ksmf#L220

Follow-up to 66ad54e curl#20357
@vszakats vszakats added build Windows Windows-specific labels Oct 16, 2026
@github-actions github-actions Bot added the cmake label Oct 16, 2026
@vszakats

vszakats commented Oct 16, 2026 •

Copy link
Copy Markdown
Member Author

Ouch, I tapped into a new CMake feature? → yes, checking against multiple configs needs 3.19. sigh.

https://ci.appveyor.com/project/curlorg/curl/builds/54910494

edit: edited #18704

@github-actions github-actions Bot added the CI Continuous Integration label Oct 16, 2026
@vszakats vszakats closed this in 9f26246 Oct 16, 2026
@vszakats
vszakats deleted the cm-silence-msvc-dbg-linker-warning branch October 16, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build CI Continuous Integration cmake tidy-up Windows Windows-specific

Development

Successfully merging this pull request may close these issues.

1 participant