File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed
Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -623,3 +623,18 @@ macOS/Clang/UndefinedSanitizer:
623623 CXX : clang++
624624 CMAKE_OPTIONS : -D EXAMPLE_USE_SANITIZER=undefined
625625 << : *macos_success_template
626+
627+ Windows/MSVC/Address Sanitizer :
628+ image : stabletec/build-core:windows-2019
629+ stage : Sanitizers
630+ parallel :
631+ matrix :
632+ - ARCH : [amd64]
633+ tags :
634+ - container
635+ - windows
636+ - ${ARCH}
637+ script :
638+ - cmake example/all/ -B build -GNinja -D EXAMPLE_USE_SANITIZER=address
639+ - ninja -C build
640+ - ninja -C build test ; if ($? -ne 0) { return 0 } else { return 1 }
Original file line number Diff line number Diff line change 8787# functional until then, either by defining `USE_SANITIZER` or
8888# `SANITIZER_ENABLE_LEGACY_SUPPORT` before including the script file.
8989
90+ include (CheckCXXCompilerFlag )
9091include (CheckCXXSourceCompiles )
9192
9293function (append_quoteless value )
@@ -100,13 +101,23 @@ endfunction()
100101function (test_san_flags RETURN_VAR )
101102 set (QUIET_BACKUP ${CMAKE_REQUIRED_QUIET} )
102103 set (CMAKE_REQUIRED_QUIET TRUE )
103- unset (${return_var } CACHE )
104+ unset (${RETURN_VAR } CACHE )
104105 set (FLAGS_BACKUP ${CMAKE_REQUIRED_FLAGS} )
105106 unset (CMAKE_REQUIRED_FLAGS)
107+ unset (test_san_flags_OPTION_TEST CACHE )
106108 foreach (ARG ${ARGN} )
109+ if (WIN32 )
110+ unset (test_san_flags_OPTION_TEST CACHE )
111+ check_cxx_compiler_flag (${ARG} test_san_flags_OPTION_TEST )
112+ if (NOT test_san_flags_OPTION_TEST)
113+ break ()
114+ endif ()
115+ endif ()
107116 set (CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${ARG} " )
108117 endforeach ()
109- check_cxx_source_compiles ("int main() { return 0; }" ${RETURN_VAR} )
118+ if (NOT DEFINED test_san_flags_OPTION_TEST OR test_san_flags_OPTION_TEST)
119+ check_cxx_source_compiles ("int main() { return 0; }" ${RETURN_VAR} )
120+ endif ()
110121 set (CMAKE_REQUIRED_FLAGS "${FLAGS_BACKUP} " )
111122 set (CMAKE_REQUIRED_QUIET "${QUIET_BACKUP} " )
112123endfunction ()
You can’t perform that action at this time.
0 commit comments