File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,11 @@ endif()
134134
135135if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
136136 # using regular Clang or AppleClang
137- add_compile_options (-Wall -Wconversion -Wshadow -Werror=conversion -Werror=sign-compare)
137+ add_compile_options (-Wall -Wconversion -Wshadow)
138+
139+ if (JSONCPP_WITH_WARNING_AS_ERROR)
140+ add_compile_options (-Werror=conversion -Werror=sign-compare)
141+ endif ()
138142elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
139143 # using GCC
140144 add_compile_options (-Wall -Wconversion -Wshadow -Wextra)
@@ -148,9 +152,11 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
148152 endif ()
149153elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" )
150154 # using Intel compiler
151- add_compile_options (-Wall -Wconversion -Wshadow -Wextra -Werror=conversion )
155+ add_compile_options (-Wall -Wconversion -Wshadow -Wextra)
152156
153- if (JSONCPP_WITH_STRICT_ISO AND NOT JSONCPP_WITH_WARNING_AS_ERROR)
157+ if (JSONCPP_WITH_WARNING_AS_ERROR)
158+ add_compile_options (-Werror=conversion)
159+ elseif (JSONCPP_WITH_STRICT_ISO)
154160 add_compile_options (-Wpedantic)
155161 endif ()
156162endif ()
You can’t perform that action at this time.
0 commit comments