From 7e03bc39b8bcdaa4e83e72ac99e117561c124951 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 15 Jun 2020 09:50:42 +0200 Subject: CMake: Improve sanitizer detection The change fixes the labels to show up correctly in the configure summary. It also allows enabling the sanitizer via the feature flags, e.g. -DFEATURE_sanitize_address=ON. Finally the qtbase sanitizer option is saved in QtBuildInternalsExtra so that repos built after qtbase have the same sanitizer options enabled. Change-Id: Ic9d9e3ce3c7ebbc244ced2e6d163d1ac8ee06b12 Fixes: QTBUG-84721 Reviewed-by: Fabian Kosmale Reviewed-by: Joerg Bornemann --- configure.cmake | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'configure.cmake') diff --git a/configure.cmake b/configure.cmake index 3863f34285..b229e4df2c 100644 --- a/configure.cmake +++ b/configure.cmake @@ -467,12 +467,37 @@ qt_feature("testcocoon" AUTODETECT OFF ) qt_feature_config("testcocoon" QMAKE_PUBLIC_CONFIG) +qt_feature("sanitize_address" + LABEL "Addresses" + AUTODETECT OFF +) +qt_feature_config("sanitize_address" QMAKE_PUBLIC_CONFIG) +qt_feature("sanitize_thread" + LABEL "Threads" + AUTODETECT OFF +) +qt_feature_config("sanitize_thread" QMAKE_PUBLIC_CONFIG) +qt_feature("sanitize_memory" + LABEL "Memory" + AUTODETECT OFF +) +qt_feature_config("sanitize_memory" QMAKE_PUBLIC_CONFIG) qt_feature("sanitize_fuzzer_no_link" LABEL "Fuzzer (instrumentation only)" PURPOSE "Adds instrumentation for fuzzing to the binaries but links to the usual main function instead of a fuzzer's." AUTODETECT OFF ) qt_feature_config("sanitize_fuzzer_no_link" QMAKE_PUBLIC_CONFIG) +qt_feature("sanitize_undefined" + LABEL "Undefined" + AUTODETECT OFF +) +qt_feature_config("sanitize_undefined" QMAKE_PUBLIC_CONFIG) +qt_feature("sanitizer" + LABEL "Sanitizers" + CONDITION QT_FEATURE_sanitize_address OR QT_FEATURE_sanitize_thread OR QT_FEATURE_sanitize_memory OR QT_FEATURE_sanitize_fuzzer_no_link OR QT_FEATURE_sanitize_undefined +) +qt_feature_config("sanitizer" QMAKE_PUBLIC_CONFIG) qt_feature("coverage_trace_pc_guard" LABEL "trace-pc-guard" AUTODETECT OFF -- cgit v1.2.3