mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-26 01:50:58 +08:00
conversion errors only if warnings as errors enabled (#1284)
This commit is contained in:
parent
ed1ab7ac45
commit
5fabc5e6d2
@ -134,7 +134,11 @@ endif()
|
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
# using regular Clang or AppleClang
|
||||
add_compile_options(-Wall -Wconversion -Wshadow -Werror=conversion -Werror=sign-compare)
|
||||
add_compile_options(-Wall -Wconversion -Wshadow)
|
||||
|
||||
if(JSONCPP_WITH_WARNING_AS_ERROR)
|
||||
add_compile_options(-Werror=conversion -Werror=sign-compare)
|
||||
endif()
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
# using GCC
|
||||
add_compile_options(-Wall -Wconversion -Wshadow -Wextra)
|
||||
@ -148,9 +152,11 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
endif()
|
||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||
# using Intel compiler
|
||||
add_compile_options(-Wall -Wconversion -Wshadow -Wextra -Werror=conversion)
|
||||
add_compile_options(-Wall -Wconversion -Wshadow -Wextra)
|
||||
|
||||
if(JSONCPP_WITH_STRICT_ISO AND NOT JSONCPP_WITH_WARNING_AS_ERROR)
|
||||
if(JSONCPP_WITH_WARNING_AS_ERROR)
|
||||
add_compile_options(-Werror=conversion)
|
||||
elseif(JSONCPP_WITH_STRICT_ISO)
|
||||
add_compile_options(-Wpedantic)
|
||||
endif()
|
||||
endif()
|
||||
|
Loading…
x
Reference in New Issue
Block a user