mirror of
https://github.com/curl/curl.git
synced 2026-07-23 02:07:15 +03:00
cmake: use CMAKE_COMPILE_WARNING_AS_ERROR if available
It's available in CMake >= 3.24. Ref: https://cmake.org/cmake/help/latest/variable/CMAKE_COMPILE_WARNING_AS_ERROR.html Closes #17183
This commit is contained in:
parent
1e9b48c010
commit
c3aa22272d
1 changed files with 8 additions and 4 deletions
|
|
@ -27,10 +27,14 @@ set(_picky "")
|
|||
set(_picky_nocheck "") # not to pass to feature checks
|
||||
|
||||
if(CURL_WERROR)
|
||||
if(MSVC)
|
||||
list(APPEND _picky_nocheck "-WX")
|
||||
else() # llvm/clang and gcc style options
|
||||
list(APPEND _picky_nocheck "-Werror")
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24)
|
||||
set(CMAKE_COMPILE_WARNING_AS_ERROR ON)
|
||||
else()
|
||||
if(MSVC)
|
||||
list(APPEND _picky_nocheck "-WX")
|
||||
else() # llvm/clang and gcc style options
|
||||
list(APPEND _picky_nocheck "-Werror")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if((CMAKE_C_COMPILER_ID STREQUAL "GNU" AND
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue