summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-09-24 17:00:25 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-09-24 18:23:17 +0200
commit303178748595f487cffc7249c8dc9bd46432253b (patch)
tree0d22efd990ae054beba2dca589e8f67461375b56 /cmake
parent22bf3a45112cfef21971362503794b79818ba54c (diff)
CMake: Fix sanitizer build when using Clang on Linux
Apparently the combination of the --no-undefined linker flag together with ASAN when building on Linux with Clang does not work. Disable --no-undefined flag in such a scenario. Note that linux-clang mkspec doesn't add that flag at all, which is why asan builds work there. Change-Id: I6167c757ce4be5d2263311bc84e5fb445b0f7c2d Fixes: QTBUG-86879 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtFlagHandlingHelpers.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/cmake/QtFlagHandlingHelpers.cmake b/cmake/QtFlagHandlingHelpers.cmake
index a71c083717..a2b498bf20 100644
--- a/cmake/QtFlagHandlingHelpers.cmake
+++ b/cmake/QtFlagHandlingHelpers.cmake
@@ -51,6 +51,9 @@ function(qt_internal_add_link_flags_no_undefined target)
return()
endif()
if (GCC OR CLANG)
+ if(CLANG AND QT_FEATURE_sanitizer)
+ return()
+ endif()
set(previous_CMAKE_REQUIRED_LINK_OPTIONS ${CMAKE_REQUIRED_LINK_OPTIONS})
set(CMAKE_REQUIRED_LINK_OPTIONS "-Wl,-undefined,error")