mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-26 10:41:03 +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")
|
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
# using regular Clang or AppleClang
|
# 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")
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
# using GCC
|
# using GCC
|
||||||
add_compile_options(-Wall -Wconversion -Wshadow -Wextra)
|
add_compile_options(-Wall -Wconversion -Wshadow -Wextra)
|
||||||
@ -148,9 +152,11 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|||||||
endif()
|
endif()
|
||||||
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
|
||||||
# using Intel compiler
|
# 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)
|
add_compile_options(-Wpedantic)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user