Skip to content

Commit 86ed860

Browse files
authored
Merge pull request open-source-parsers#589 from ya1gaurav/patch-42
Fix warning issue with gcc flags. closes open-source-parsers#586
2 parents 264c3ed + c68443f commit 86ed860

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,11 @@ 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+
ENDIF()
118+
IF(JSONCPP_WITH_WARNING_AS_ERROR)
119+
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=conversion")
117120
ENDIF()
118121
ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
119122
# using Intel compiler

0 commit comments

Comments
 (0)