Skip to content

Commit 11c48d0

Browse files
authored
Fix warning issue with gcc flags.
PR for - open-source-parsers#586 Separating the default options for compiler flags.
1 parent 264c3ed commit 11c48d0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,10 @@ ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
112112
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wconversion -Wshadow -Wextra")
113113
# not yet ready for -Wsign-conversion
114114

115-
IF(JSONCPP_WITH_STRICT_ISO AND NOT JSONCPP_WITH_WARNING_AS_ERROR)
116-
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=conversion -pedantic")
115+
IF(JSONCPP_WITH_STRICT_ISO)
116+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
117+
IF(JSONCPP_WITH_WARNING_AS_ERROR)
118+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=conversion")
117119
ENDIF()
118120
ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
119121
# using Intel compiler

0 commit comments

Comments
 (0)