diff --git a/CMakeLists.txt b/CMakeLists.txt index 7775321d4..eb5e8873a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,12 @@ set(build-shared $) set(build-windows-dll $,${build-shared}>) set(not-msvc $>) set(msvc-shared_rt $) +set(not-intel $>) +set(not-gnu $>) +# -Weffc++ does not work correctly for some compilers +set(weffcpp-compatible $) +# -Wshadow does not work correctly for some compilers +set(wshadow-compatible $) if (NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY) set(CMAKE_MSVC_RUNTIME_LIBRARY @@ -93,7 +99,9 @@ endif() target_compile_options(yaml-cpp PRIVATE - $<${not-msvc}:-Wall -Wextra -Wshadow -Weffc++ -Wno-long-long> + $<${not-msvc}:-Wall -Wextra -Wno-long-long> + $<${wshadow-compatible}:-Wshadow > + $<${weffcpp-compatible}:-Weffc++> $<${not-msvc}:-pedantic -pedantic-errors> $<$:-MTd>