-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmake: Disable
ctime_tests
if build with -fsanitize=memory
Clang >= 16 has `-fsanitize-memory-param-retval` turned on by default, which is incompatible with
- Loading branch information
Showing
2 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
include_guard(GLOBAL) | ||
include(CheckCSourceCompiles) | ||
|
||
function(check_memory_sanitizer output) | ||
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) | ||
check_c_source_compiles(" | ||
#if defined(__has_feature) | ||
# if __has_feature(memory_sanitizer) | ||
/* MemorySanitizer is enabled. */ | ||
# elif | ||
# error \"MemorySanitizer is disabled.\" | ||
# endif | ||
#else | ||
# error \"__has_feature is not defined.\" | ||
#endif | ||
" HAVE_MSAN) | ||
set(${output} ${HAVE_MSAN} PARENT_SCOPE) | ||
endfunction() |