summaryrefslogtreecommitdiffstats
path: root/config/sanitizer/sanitizers.cmake
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2022-01-19 23:30:33 (GMT)
committerGitHub <noreply@github.com>2022-01-19 23:30:33 (GMT)
commitd7c360df67cdaa4ea7e08076334a45f6ed859a90 (patch)
tree1b1e4018fbb8a61326b41f015ea9715f034d64d7 /config/sanitizer/sanitizers.cmake
parent407c52f3977df9aaf7a27a3343ea146c3f497a00 (diff)
downloadhdf5-d7c360df67cdaa4ea7e08076334a45f6ed859a90.zip
hdf5-d7c360df67cdaa4ea7e08076334a45f6ed859a90.tar.gz
hdf5-d7c360df67cdaa4ea7e08076334a45f6ed859a90.tar.bz2
Fix cmake dynamic analysis on windows (#1377)
Fix sanitizer flag form on windows Add search paths to windows code-coverage
Diffstat (limited to 'config/sanitizer/sanitizers.cmake')
-rw-r--r--config/sanitizer/sanitizers.cmake11
1 files changed, 10 insertions, 1 deletions
diff --git a/config/sanitizer/sanitizers.cmake b/config/sanitizer/sanitizers.cmake
index 8bf1d5b..b06992f 100644
--- a/config/sanitizer/sanitizers.cmake
+++ b/config/sanitizer/sanitizers.cmake
@@ -83,12 +83,21 @@ if(USE_SANITIZER)
elseif(MSVC)
if(USE_SANITIZER MATCHES "([Aa]ddress)")
message(STATUS "Building with Address sanitizer")
- append("/fsanitize=address" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS)
+ append("-fsanitize=address" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS)
else()
message(FATAL_ERROR "This sanitizer not yet supported in the MSVC environment: ${USE_SANITIZER}")
endif()
else()
message(FATAL_ERROR "USE_SANITIZER is not supported on this platform.")
endif()
+ elseif(MSVC)
+ if(USE_SANITIZER MATCHES "([Aa]ddress)")
+ message(STATUS "Building with Address sanitizer")
+ append("/fsanitize=address" CMAKE_C_SANITIZER_FLAGS CMAKE_CXX_SANITIZER_FLAGS)
+ else()
+ message(FATAL_ERROR "This sanitizer not yet supported in the MSVC environment: ${USE_SANITIZER}")
+ endif()
+ else()
+ message(FATAL_ERROR "USE_SANITIZER is not supported on this platform.")
endif()
endif()