From 36eed4cb9bdcbe940f789c5d1a4e8e356db2b01f Mon Sep 17 00:00:00 2001 From: Mark Schofield <34426337+MarkSchofield@users.noreply.github.com> Date: Tue, 25 Nov 2025 23:07:58 -0800 Subject: [PATCH 1/2] Use the target architecture to specify the path to the ASAN runtime --- WindowsCMake/Asan.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/WindowsCMake/Asan.cmake b/WindowsCMake/Asan.cmake index f4bc3ed..ba7f46b 100644 --- a/WindowsCMake/Asan.cmake +++ b/WindowsCMake/Asan.cmake @@ -50,8 +50,11 @@ function(windowscmake_add_asan_target) set(ASAN_PLATFORM i386) endif() + # When specifying the ASAN_DLL_PATH, the DLL is available in the _host_ architecture folder for the architecture + # being targeted - as a result `Host${CMAKE_VS_PLATFORM_TOOLSET_ARCHITECTURE}` is used, and *not* + # `Host${CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE}` set(ASAN_LIB_PATH "${VS_TOOLSET_PATH}/lib/${CMAKE_VS_PLATFORM_TOOLSET_ARCHITECTURE}") - set(ASAN_DLL_PATH "${VS_TOOLSET_PATH}/bin/Host${CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE}/${CMAKE_VS_PLATFORM_TOOLSET_ARCHITECTURE}") + set(ASAN_DLL_PATH "${VS_TOOLSET_PATH}/bin/Host${CMAKE_VS_PLATFORM_TOOLSET_ARCHITECTURE}/${CMAKE_VS_PLATFORM_TOOLSET_ARCHITECTURE}") if((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") OR (CMAKE_C_COMPILER_ID STREQUAL "MSVC")) set(ASAN_LIB "${ASAN_LIB_PATH}/VCAsan.lib") From 68888b87837f11d9b77c9bc6f747476052a79584 Mon Sep 17 00:00:00 2001 From: Mark Schofield <34426337+MarkSchofield@users.noreply.github.com> Date: Tue, 25 Nov 2025 23:32:45 -0800 Subject: [PATCH 2/2] Add 'ASAN' presets to '.github/workflows/ci.yaml' --- .github/workflows/ci.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c2baa37..3713afc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -60,10 +60,16 @@ jobs: - Release buildPreset: - windows-msvc-x64 + - windows-msvc-x64+asan - windows-msvc-x86 - windows-msvc-arm64 - windows-clang-x64 + - windows-clang-x64+asan - windows-clangcl-x64 + - windows-clangcl-x64+asan + exclude: + - buildPreset: windows-clangcl-x64+asan # ASan not supported with clangcl on Debug builds. + configuration: Debug runs-on: windows-latest steps: - name: Checkout