From 06f41e986c25fc2fd68074fce314a55f5c1d003d Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 13 Jan 2015 10:45:23 -0500 Subject: jsoncpp: Disable warnings to avoid changing 3rd party code Add '-w' or equivalent flag on compilers supporting it. Tell MSVC to use its lowest warning level inside jsoncpp sources. --- Utilities/cmjsoncpp/CMakeLists.txt | 8 ++++++++ Utilities/cmjsoncpp/include/json/config.h | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/Utilities/cmjsoncpp/CMakeLists.txt b/Utilities/cmjsoncpp/CMakeLists.txt index 0ff8820..1c863f8 100644 --- a/Utilities/cmjsoncpp/CMakeLists.txt +++ b/Utilities/cmjsoncpp/CMakeLists.txt @@ -1,5 +1,13 @@ project(JsonCpp CXX) +# Disable warnings to avoid changing 3rd party code. +if(CMAKE_CXX_COMPILER_ID MATCHES + "^(GNU|Clang|AppleClang|XL|VisualAge|SunPro|MIPSpro|HP|Intel)$") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "PathScale") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -woffall") +endif() + set(JSONCPP_SOURCES src/lib_json/json_batchallocator.h src/lib_json/json_reader.cpp diff --git a/Utilities/cmjsoncpp/include/json/config.h b/Utilities/cmjsoncpp/include/json/config.h index 4d31797..6847ceb 100644 --- a/Utilities/cmjsoncpp/include/json/config.h +++ b/Utilities/cmjsoncpp/include/json/config.h @@ -9,6 +9,10 @@ // Include KWSys Large File Support configuration. #include +#if defined(_MSC_VER) +# pragma warning(push,1) +#endif + /// If defined, indicates that json library is embedded in CppTL library. //# define JSON_IN_CPPTL 1 -- cgit v0.12