aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Rosenkränzer <bero@lindev.ch>2022-05-18 12:00:50 +0200
committerBernhard Rosenkränzer <bero@lindev.ch>2022-05-18 12:00:50 +0200
commitdbcdeb666acab36b539f0cd6b37fd17c776024b6 (patch)
treeca2160a3fef115ad7aa2aee2257ec5eee47f6f56
parentd66cf5f644b7e7fc705fc3a154e92d4c92606222 (diff)
Limit the clang AST crash workaround to clang 7.0
The workaround disables some functionality when building with clang in order to work around a clang bug that was introduced in 7.0 and fixed in 8.0. Limit the workaround to clang versions actually affected by the bug. Verified to work perfectly when built with clang 14.0.3.
-rw-r--r--CMakeLists.txt4
1 files changed, 2 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 76d9cb5b..434a57c9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -56,8 +56,8 @@ if (CLAZY_ENABLE_SANITIZERS)
endif()
endif()
-if (CLAZY_AST_MATCHERS_CRASH_WORKAROUND AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
- message("Enabling AST Matchers workaround. Consider building with gcc instead. See bug #392223.")
+if (CLAZY_AST_MATCHERS_CRASH_WORKAROUND AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 7.0 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
+ message("Enabling AST Matchers workaround. Consider updating clang or building with gcc instead. See bug #392223.")
add_definitions(-DCLAZY_DISABLE_AST_MATCHERS)
endif()