Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Molenkamp <github@lazydodo.com>2021-03-30 04:11:17 +0300
committerRay Molenkamp <github@lazydodo.com>2021-03-30 04:11:17 +0300
commitf9eaf93d37957fb29eefb720022edd988c540369 (patch)
tree00c3913978394a63679b1b947793e6b8b3d7f500 /source/creator/CMakeLists.txt
parent6c33d3d01b6237cbe854b1d6ca54ac9680bb0563 (diff)
MSVC: ASAN support for VS 16.9
This enables ASAN support when used with VS 16.9 enable as usual in cmake with the WITH_COMPILER_ASAN option, or when using make.bat just tag on `asan' to the invocation, ie: `make lite 2019 asan` MSVC: Asan support for 16.9 This enables ASAN support when used with VS 16.9 enable as usual in cmake with the WITH_COMPILER_ASAN option, or when using make.bat just tag on `asan' to the invocation, ie: `make lite 2019 asan` Differential Revision: https://developer.blender.org/D7794 Reviewed By: brecht, sergey
Diffstat (limited to 'source/creator/CMakeLists.txt')
-rw-r--r--source/creator/CMakeLists.txt20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
index d9064682203..90840aa8358 100644
--- a/source/creator/CMakeLists.txt
+++ b/source/creator/CMakeLists.txt
@@ -693,6 +693,26 @@ elseif(WIN32)
DESTINATION "."
)
endif()
+ if(MSVC_ASAN)
+ # The asan dll's can be found in the same folder as the compiler, this is the easiest way to find these.
+ string(REPLACE "cl.exe" "clang_rt.asan_dynamic-x86_64.dll" ASAN_DLL ${CMAKE_C_COMPILER})
+ string(REPLACE "cl.exe" "clang_rt.asan_dbg_dynamic-x86_64.dll" ASAN_DEBUG_DLL ${CMAKE_C_COMPILER})
+ if(NOT EXISTS "${ASAN_DLL}")
+ message(FATAL_ERROR "Asan is enabled, but the ASAN runtime is not detected, this is an optional component during the MSVC install, please install it")
+ endif()
+ install(
+ FILES ${ASAN_DLL}
+ DESTINATION "."
+ CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel
+ )
+ install(
+ FILES ${ASAN_DEBUG_DLL}
+ DESTINATION "."
+ CONFIGURATIONS Debug
+ )
+ unset(ASAN_DLL)
+ unset(ASAN_DEBUG_DLL)
+ endif()
if(WITH_GMP)
install(