From d6ed73f240742943942ea56f5e20ba5be646f721 Mon Sep 17 00:00:00 2001 From: Patrick Boettcher Date: Wed, 20 Mar 2019 16:58:03 +0100 Subject: [PATCH] Fix #53: only add -Wall/-Wextra for GCC and Clang --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 95fef2b..c209683 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,12 +60,13 @@ target_include_directories(json-schema-validator target_compile_features(json-schema-validator PUBLIC cxx_range_for) # for C++11 - flags -# Enable more compiler warnings, except when using Visual Studio compiler -if(NOT MSVC) + +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") target_compile_options(json-schema-validator PRIVATE -Wall -Wextra) endif() + target_link_libraries(json-schema-validator PUBLIC json-hpp)