From 11c48d0047b8905ae475edb31d3b5a5f23d25e98 Mon Sep 17 00:00:00 2001 From: Gaurav Date: Fri, 10 Mar 2017 10:22:33 +0530 Subject: [PATCH 1/2] Fix warning issue with gcc flags. PR for - https://github.com/open-source-parsers/jsoncpp/issues/586 Separating the default options for compiler flags. --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 330ea54..e1d324a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,8 +112,10 @@ ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wconversion -Wshadow -Wextra") # not yet ready for -Wsign-conversion - IF(JSONCPP_WITH_STRICT_ISO AND NOT JSONCPP_WITH_WARNING_AS_ERROR) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=conversion -pedantic") + IF(JSONCPP_WITH_STRICT_ISO) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic") + IF(JSONCPP_WITH_WARNING_AS_ERROR) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=conversion") ENDIF() ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") # using Intel compiler From c68443f3a032572039a329ce33ce4c12e0807b67 Mon Sep 17 00:00:00 2001 From: Gaurav Date: Fri, 10 Mar 2017 10:33:03 +0530 Subject: [PATCH 2/2] Fix Cmake build issue FIx cmake build. --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e1d324a..7c38e27 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,6 +114,7 @@ ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") IF(JSONCPP_WITH_STRICT_ISO) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic") + ENDIF() IF(JSONCPP_WITH_WARNING_AS_ERROR) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=conversion") ENDIF()