Closed smanders closed 3 years ago
CMake shouldn't add /W3 in Windows-MSVC.cmake https://gitlab.kitware.com/cmake/cmake/-/issues/18317
It is impossible to reliably use target_compile_options() on MSVC https://gitlab.kitware.com/cmake/cmake/-/issues/19084
How to set compiler options with CMake in Visual Studio 2017 https://stackoverflow.com/questions/45995784/how-to-set-compiler-options-with-cmake-in-visual-studio-2017
How to set warning level in CMake? https://stackoverflow.com/questions/2368811/how-to-set-warning-level-in-cmake
Modern way to set compiler flags in cross-platform cmake project https://stackoverflow.com/questions/45955272/modern-way-to-set-compiler-flags-in-cross-platform-cmake-project
completed with commit to dev branch referenced above
cmake >= 3.15 no longer contains warning flags like
/W3
by default https://cmake.org/cmake/help/v3.17/release/3.15.html#other-changeshttps://cmake.org/cmake/help/v3.17/policy/CMP0092.html
I suspect that developers who are seeing the warning treated as an error have not cleaned out their cmake cache in some time and probably have
/W3
set from a cmake run with an earlier version of cmakeI will be adding
/W3
to externpro'sxpSetFlagsMsvc()
https://github.com/smanders/externpro/blob/21.02/modules/xpfunmac.cmake#L2007-L2044 -- until projects are using externpro >= 21.03 they might consider adding it temporarily