mirror of
https://github.com/curl/curl.git
synced 2026-01-18 17:21:26 +01:00
build: replace -pedantic with -Wpedantic when supported
To use the modern form when possible. The modern option also allows
using the `no-` prefix to disable.
Supported by: gcc 4.8+, clang 3.2+ (= appleclang 4.2+)
This also automatically changes `-clang:-pedantic` to `-Wpedantic` in
clang-cl builds.
Refs:
9877f689f2
https://gcc.gnu.org/onlinedocs/gcc-4.8.5/gcc/Warning-Options.html
Closes #20010
This commit is contained in:
@@ -75,9 +75,15 @@ if(PICKY_COMPILER)
|
||||
set(_picky_enable "-W")
|
||||
endif()
|
||||
|
||||
list(APPEND _picky_enable
|
||||
-Wall -pedantic
|
||||
)
|
||||
list(APPEND _picky_enable "-Wall")
|
||||
|
||||
if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.2) OR
|
||||
(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) OR
|
||||
CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
|
||||
list(APPEND _picky_enable "-Wpedantic") # clang 3.2 gcc 4.8 appleclang 4.2
|
||||
else()
|
||||
list(APPEND _picky_enable "-pedantic")
|
||||
endif()
|
||||
|
||||
# ----------------------------------
|
||||
# Add new options here, if in doubt:
|
||||
|
||||
Reference in New Issue
Block a user