File tree 2 files changed +28
-2
lines changed
2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -623,3 +623,18 @@ macOS/Clang/UndefinedSanitizer:
623
623
CXX : clang++
624
624
CMAKE_OPTIONS : -D EXAMPLE_USE_SANITIZER=undefined
625
625
<< : *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 87
87
# functional until then, either by defining `USE_SANITIZER` or
88
88
# `SANITIZER_ENABLE_LEGACY_SUPPORT` before including the script file.
89
89
90
+ include (CheckCXXCompilerFlag)
90
91
include (CheckCXXSourceCompiles)
91
92
92
93
function (append_quoteless value )
@@ -100,13 +101,23 @@ endfunction()
100
101
function (test_san_flags RETURN_VAR)
101
102
set (QUIET_BACKUP ${CMAKE_REQUIRED_QUIET} )
102
103
set (CMAKE_REQUIRED_QUIET TRUE )
103
- unset (${return_var } CACHE )
104
+ unset (${RETURN_VAR } CACHE )
104
105
set (FLAGS_BACKUP ${CMAKE_REQUIRED_FLAGS} )
105
106
unset (CMAKE_REQUIRED_FLAGS)
107
+ unset (test_san_flags_OPTION_TEST CACHE )
106
108
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 ()
107
116
set (CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${ARG} " )
108
117
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 ()
110
121
set (CMAKE_REQUIRED_FLAGS "${FLAGS_BACKUP} " )
111
122
set (CMAKE_REQUIRED_QUIET "${QUIET_BACKUP} " )
112
123
endfunction ()
You can’t perform that action at this time.
0 commit comments