File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,11 @@ endif()
134
134
135
135
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
136
136
# 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 ()
138
142
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
139
143
# using GCC
140
144
add_compile_options (-Wall -Wconversion -Wshadow -Wextra)
@@ -148,9 +152,11 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
148
152
endif ()
149
153
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel" )
150
154
# using Intel compiler
151
- add_compile_options (-Wall -Wconversion -Wshadow -Wextra -Werror=conversion )
155
+ add_compile_options (-Wall -Wconversion -Wshadow -Wextra)
152
156
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)
154
160
add_compile_options (-Wpedantic)
155
161
endif ()
156
162
endif ()
You can’t perform that action at this time.
0 commit comments