From c848ee3388db3c1b2d9174a8d6329531de5e2feb Mon Sep 17 00:00:00 2001 From: Ryan Krattiger Date: Tue, 6 Oct 2020 15:19:53 -0500 Subject: [PATCH] issue_937: Conditionally disabled -Weffc++ and -Wshadow for compilers with broken implementations --- CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7775321..eb5e887 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>