Change #286490
| Category | None |
| Changed by | Viktor Szakats <commit@vsz.me> |
| Changed at | Fri 16 Oct 2026 14:33:55 |
| Repository | https://api.github.com/repos/curl/curl |
| Project | curl/curl |
| Branch | master |
| Revision | 9f262469678ff741e3a10f2b2fe338d93e65d894 |
Comments
cmake: silence MSVC linker warning in debug builds with `CURL_DROP_UNUSED=ON`
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 66ad54e46b934e17e786e10e0292fa6f1f3fa816 #20357
Follow-up to a72b479decd555c9e9c2c50ded34e317123174f2 #15657
Closes #23435
Changed files
- .github/workflows/windows.yml
- CMakeLists.txt