cmake: prefer dash-style MSVC options

They play better with Unixy shells. The compiler has been supporting
dash options since its early versions.

Also fix to detect warnings options passed in dash-style.

Closes #16063
This commit is contained in:
Viktor Szakats 2025-01-21 11:30:52 +01:00
parent cd9107e012
commit 8dfd271c35
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
3 changed files with 12 additions and 12 deletions

View file

@ -249,7 +249,7 @@ if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND MSVC)
if(_ccopt MATCHES "^-W" AND NOT _ccopt STREQUAL "-Wall")
list(APPEND _picky_tmp ${_ccopt})
else()
list(APPEND _picky_tmp "/clang:${_ccopt}")
list(APPEND _picky_tmp "-clang:${_ccopt}")
endif()
endforeach()
set(_picky ${_picky_tmp})