-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
18abd73
commit 8e2cc80
Showing
1 changed file
with
4 additions
and
4 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Author: Zhuo Zhang <[email protected]> | ||
# Homepage: https://github.com/zchrissirhcz/rocbuild | ||
# Last update: 2024-11-09 12:37:00 | ||
# Last update: 2024-12-12 00:14:00 | ||
cmake_minimum_required(VERSION 3.15) | ||
include_guard() | ||
|
||
|
@@ -61,16 +61,16 @@ if(ASAN_AVAILABLE) | |
|
||
# https://devblogs.microsoft.com/cppblog/msvc-address-sanitizer-one-dll-for-all-runtime-configurations/ | ||
if((CMAKE_C_COMPILER_VERSION STRGREATER_EQUAL 17.7) OR (CMAKE_CXX_COMPILER_VERSION STRGREATER_EQUAL 17.7)) | ||
if(CMAKE_GENERATOR MATCHES "Visual Studio") # for running/debugging in Visual Studio | ||
cmake_minimum_required(VERSION 3.27) | ||
if((CMAKE_GENERATOR MATCHES "Visual Studio") AND (CMAKE_VERSION VERSION_GREATER_EQUAL "3.27")) # for running/debugging in Visual Studio | ||
if(CMAKE_GENERATOR_PLATFORM MATCHES "x64") | ||
set(CMAKE_VS_DEBUGGER_ENVIRONMENT "PATH=$(VC_ExecutablePath_x64);%PATH%\nASAN_SYMBOLIZER_PATH=$(VC_ExecutablePath_x64)") | ||
elseif(CMAKE_GENERATOR_PLATFORM MATCHES "Win32") | ||
set(CMAKE_VS_DEBUGGER_ENVIRONMENT "PATH=$(VC_ExecutablePath_x86);%PATH%\nASAN_SYMBOLIZER_PATH=$(VC_ExecutablePath_x86)") | ||
endif() | ||
endif() | ||
|
||
if((CMAKE_GENERATOR MATCHES "Ninja") OR COPY_ASAN_DLLS) | ||
if((CMAKE_GENERATOR MATCHES "Ninja") OR COPY_ASAN_DLLS OR | ||
((CMAKE_GENERATOR MATCHES "Visual Studio") AND (CMAKE_VERSION VERSION_LESS "3.27")) ) | ||
get_filename_component(COMPILER_DIR ${CMAKE_CXX_COMPILER} DIRECTORY) | ||
file(GLOB ASAN_DLLS "${COMPILER_DIR}/clang_rt.asan_dynamic*.dll") | ||
foreach(ASAN_DLL ${ASAN_DLLS}) | ||
|