qcompilerdetection: Introduce QT_ASAN_ENABLED

This allows us to check whether Qt is compiled with ASAN enabled; it is
mostly used to disable tests which are too slow under ASAN

Change-Id: I381e287c4a72ffefd4cc92850451477032ad4204
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Fabian Kosmale 2022-11-28 21:06:33 +01:00
parent a38fe10fff
commit ba2f8c20dd

View File

@ -445,6 +445,16 @@
# define __has_include_next(x) 0
#endif
/*
detecting ASAN can be helpful to disable slow tests
clang uses feature, gcc defines __SANITIZE_ADDRESS__
unconditionally check both in case other compilers mirror
either of those options
*/
#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
# define QT_ASAN_ENABLED
#endif
#ifdef __cplusplus
# if __has_include(<version>) /* remove this check once Integrity, QNX have caught up */
# include <version>