-
- Downloads
MSVC: Do not add /W3 to CMAKE_<LANG>_FLAGS by default
We do not add default warning flags on other compilers, and having a warning flag in the default flags makes it hard for projects to customize the warning level. They need to use string processing to remove `/W3` from `CMAKE_{C,CXX}_FLAGS`. Therefore we should drop it. However, projects may be using string processing to replace `/W3` with another flag, so we cannot simply drop it. Add a policy to drop it in a compatible way. Fixes: #18317
Showing
- Help/manual/cmake-policies.7.rst 1 addition, 0 deletionsHelp/manual/cmake-policies.7.rst
- Help/policy/CMP0092.rst 38 additions, 0 deletionsHelp/policy/CMP0092.rst
- Help/release/dev/msvc-warning-flags.rst 6 additions, 0 deletionsHelp/release/dev/msvc-warning-flags.rst
- Modules/Platform/Windows-Intel-Fortran.cmake 8 additions, 1 deletionModules/Platform/Windows-Intel-Fortran.cmake
- Modules/Platform/Windows-MSVC.cmake 15 additions, 2 deletionsModules/Platform/Windows-MSVC.cmake
- Modules/Platform/Windows-NVIDIA-CUDA.cmake 10 additions, 1 deletionModules/Platform/Windows-NVIDIA-CUDA.cmake
- Source/cmPolicies.h 4 additions, 1 deletionSource/cmPolicies.h
- Tests/RunCMake/CMakeLists.txt 1 addition, 0 deletionsTests/RunCMake/CMakeLists.txt
- Tests/RunCMake/MSVCWarningFlags/CMP0092-NEW.cmake 2 additions, 0 deletionsTests/RunCMake/MSVCWarningFlags/CMP0092-NEW.cmake
- Tests/RunCMake/MSVCWarningFlags/CMP0092-OLD.cmake 2 additions, 0 deletionsTests/RunCMake/MSVCWarningFlags/CMP0092-OLD.cmake
- Tests/RunCMake/MSVCWarningFlags/CMP0092-WARN.cmake 2 additions, 0 deletionsTests/RunCMake/MSVCWarningFlags/CMP0092-WARN.cmake
- Tests/RunCMake/MSVCWarningFlags/CMP0092-common.cmake 12 additions, 0 deletionsTests/RunCMake/MSVCWarningFlags/CMP0092-common.cmake
- Tests/RunCMake/MSVCWarningFlags/CMakeLists.txt 3 additions, 0 deletionsTests/RunCMake/MSVCWarningFlags/CMakeLists.txt
- Tests/RunCMake/MSVCWarningFlags/RunCMakeTest.cmake 5 additions, 0 deletionsTests/RunCMake/MSVCWarningFlags/RunCMakeTest.cmake
Loading
Please register or sign in to comment