1. `CMAKE_C_FLAGS` may apply to other projects, and deleting/altering it
may be unexpected.
2. We pass `-W4`/`-Wall` internally now, which do override custom
`-W<n>` options in all supported MSVC versions.
(as tested with Visual Studio generators)
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/
51945416
Follow-up to
e86542038dda88dadf8959584e803895f979310c #17047
Ref:
866e02935deb28373130116dac578d84e057a03e #1711
Closes #17179
endif()
if(MSVC)
- # Use the highest warning level for Visual Studio.
- string(REGEX REPLACE "[/-]W[0-4]" "" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
- list(APPEND _picky "-W4")
+ list(APPEND _picky "-W4") # Use the highest warning level for Visual Studio.
elseif(BORLAND)
list(APPEND _picky "-w-") # Disable warnings on Borland to avoid changing 3rd party code.
endif()