Skip to content

Commit

Permalink
Merge pull request #1835 from CaseyCarter/windows-asan
Browse files Browse the repository at this point in the history
Enable ASan in Windows CI
  • Loading branch information
ericniebler authored Sep 5, 2024
2 parents 2f0a340 + 213ba99 commit a33616b
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions .github/workflows/range-v3-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -350,12 +350,13 @@ jobs:

# MSVC 2022
- {
name: "Windows MSVC 2022 Debug (C++17)", artifact: "Windows-MSVC.tar.xz",
name: "Windows MSVC 2022 Debug (C++17) / ASAN", artifact: "Windows-MSVC.tar.xz",
os: windows-latest,
build_type: Debug,
cc: "cl", cxx: "cl",
environment_script: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat",
cxx_standard: 17,
cxx_asan: true,
}
- {
name: "Windows MSVC 2022 Release (C++17)", artifact: "Windows-MSVC.tar.xz",
Expand All @@ -366,12 +367,13 @@ jobs:
cxx_standard: 17,
}
- {
name: "Windows MSVC 2022 Debug (C++20)", artifact: "Windows-MSVC.tar.xz",
name: "Windows MSVC 2022 Debug (C++20) / ASAN", artifact: "Windows-MSVC.tar.xz",
os: windows-latest,
build_type: Debug,
cc: "cl", cxx: "cl",
environment_script: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat",
cxx_standard: 20,
cxx_asan: true,
}
- {
name: "Windows MSVC 2022 Release (C++20)", artifact: "Windows-MSVC.tar.xz",
Expand Down Expand Up @@ -469,7 +471,7 @@ jobs:
COMMAND "${{ matrix.config.environment_script }}" && set
OUTPUT_FILE environment_script_output.txt
)
set(cxx_flags "/permissive- /EHsc")
set(cxx_flags "/nologo /permissive- /EHsc")
file(STRINGS environment_script_output.txt output_lines)
foreach(line IN LISTS output_lines)
if (line MATCHES "^([a-zA-Z0-9_-]+)=(.*)$")
Expand All @@ -495,14 +497,23 @@ jobs:
endif()
if ("x${{ matrix.config.cxx_asan }}" STREQUAL "xtrue")
set(cxx_flags "${cxx_flags} -fsanitize=address -fno-omit-frame-pointer")
set(cxx_flags "${cxx_flags} -fsanitize=address")
if ("${{ runner.os }}" STREQUAL "Windows")
set(link_flags "${link_flags} /INFERASANLIBS /INCREMENTAL:NO")
else()
set(cxx_flags "${cxx_flags} -fno-omit-frame-pointer")
endif()
endif()
set(cxx_concepts ON)
if ("x${{ matrix.config.cxx_concepts }}" STREQUAL "xfalse")
set(cxx_concepts OFF)
endif()
if ("${{ runner.os }}" STREQUAL "Windows")
set(link_flags "${link_flags} /NOLOGO")
endif()
execute_process(
COMMAND ${{ steps.cmake_and_ninja.outputs.cmake_dir }}/cmake
-S .
Expand Down Expand Up @@ -562,6 +573,15 @@ jobs:
set(ENV{CTEST_OUTPUT_ON_FAILURE} "ON")
if ("${{ runner.os }}" STREQUAL "Windows" AND NOT "x${{ matrix.config.environment_script }}" STREQUAL "x")
file(STRINGS environment_script_output.txt output_lines)
foreach(line IN LISTS output_lines)
if (line MATCHES "^([a-zA-Z0-9_-]+)=(.*)$")
set(ENV{${CMAKE_MATCH_1}} "${CMAKE_MATCH_2}")
endif()
endforeach()
endif()
execute_process(
COMMAND ${{ steps.cmake_and_ninja.outputs.cmake_dir }}/ctest --verbose -j ${N}
WORKING_DIRECTORY build
Expand Down

0 comments on commit a33616b

Please sign in to comment.