Skip to content

Commit 17fc9b1

Browse files
committed
CMakeLists.txt: Treat conversion warning as error only with JSONCPP_WITH_WARNING_AS_ERROR=On
Fixes errors when building with buildroot: http://autobuild.buildroot.net/?reason=jsoncpp-1.7.2 Signed-off-by: Bernd Kuhls <[email protected]>
1 parent 980cdf0 commit 17fc9b1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,11 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
107107
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wconversion -Wshadow -Werror=conversion -Werror=sign-compare")
108108
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
109109
# using GCC
110-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wconversion -Wshadow -Wextra -Werror=conversion")
110+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wconversion -Wshadow -Wextra")
111111
# not yet ready for -Wsign-conversion
112112

113113
if (JSONCPP_WITH_STRICT_ISO AND NOT JSONCPP_WITH_WARNING_AS_ERROR)
114-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
114+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=conversion -pedantic")
115115
endif ()
116116
endif()
117117

0 commit comments

Comments
 (0)