Skip to content

Commit a33616b

Browse files
authored
Merge pull request #1835 from CaseyCarter/windows-asan
Enable ASan in Windows CI
2 parents 2f0a340 + 213ba99 commit a33616b

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

.github/workflows/range-v3-ci.yml

+24-4
Original file line numberDiff line numberDiff line change
@@ -350,12 +350,13 @@ jobs:
350350

351351
# MSVC 2022
352352
- {
353-
name: "Windows MSVC 2022 Debug (C++17)", artifact: "Windows-MSVC.tar.xz",
353+
name: "Windows MSVC 2022 Debug (C++17) / ASAN", artifact: "Windows-MSVC.tar.xz",
354354
os: windows-latest,
355355
build_type: Debug,
356356
cc: "cl", cxx: "cl",
357357
environment_script: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat",
358358
cxx_standard: 17,
359+
cxx_asan: true,
359360
}
360361
- {
361362
name: "Windows MSVC 2022 Release (C++17)", artifact: "Windows-MSVC.tar.xz",
@@ -366,12 +367,13 @@ jobs:
366367
cxx_standard: 17,
367368
}
368369
- {
369-
name: "Windows MSVC 2022 Debug (C++20)", artifact: "Windows-MSVC.tar.xz",
370+
name: "Windows MSVC 2022 Debug (C++20) / ASAN", artifact: "Windows-MSVC.tar.xz",
370371
os: windows-latest,
371372
build_type: Debug,
372373
cc: "cl", cxx: "cl",
373374
environment_script: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat",
374375
cxx_standard: 20,
376+
cxx_asan: true,
375377
}
376378
- {
377379
name: "Windows MSVC 2022 Release (C++20)", artifact: "Windows-MSVC.tar.xz",
@@ -469,7 +471,7 @@ jobs:
469471
COMMAND "${{ matrix.config.environment_script }}" && set
470472
OUTPUT_FILE environment_script_output.txt
471473
)
472-
set(cxx_flags "/permissive- /EHsc")
474+
set(cxx_flags "/nologo /permissive- /EHsc")
473475
file(STRINGS environment_script_output.txt output_lines)
474476
foreach(line IN LISTS output_lines)
475477
if (line MATCHES "^([a-zA-Z0-9_-]+)=(.*)$")
@@ -495,14 +497,23 @@ jobs:
495497
endif()
496498
497499
if ("x${{ matrix.config.cxx_asan }}" STREQUAL "xtrue")
498-
set(cxx_flags "${cxx_flags} -fsanitize=address -fno-omit-frame-pointer")
500+
set(cxx_flags "${cxx_flags} -fsanitize=address")
501+
if ("${{ runner.os }}" STREQUAL "Windows")
502+
set(link_flags "${link_flags} /INFERASANLIBS /INCREMENTAL:NO")
503+
else()
504+
set(cxx_flags "${cxx_flags} -fno-omit-frame-pointer")
505+
endif()
499506
endif()
500507
501508
set(cxx_concepts ON)
502509
if ("x${{ matrix.config.cxx_concepts }}" STREQUAL "xfalse")
503510
set(cxx_concepts OFF)
504511
endif()
505512
513+
if ("${{ runner.os }}" STREQUAL "Windows")
514+
set(link_flags "${link_flags} /NOLOGO")
515+
endif()
516+
506517
execute_process(
507518
COMMAND ${{ steps.cmake_and_ninja.outputs.cmake_dir }}/cmake
508519
-S .
@@ -562,6 +573,15 @@ jobs:
562573
563574
set(ENV{CTEST_OUTPUT_ON_FAILURE} "ON")
564575
576+
if ("${{ runner.os }}" STREQUAL "Windows" AND NOT "x${{ matrix.config.environment_script }}" STREQUAL "x")
577+
file(STRINGS environment_script_output.txt output_lines)
578+
foreach(line IN LISTS output_lines)
579+
if (line MATCHES "^([a-zA-Z0-9_-]+)=(.*)$")
580+
set(ENV{${CMAKE_MATCH_1}} "${CMAKE_MATCH_2}")
581+
endif()
582+
endforeach()
583+
endif()
584+
565585
execute_process(
566586
COMMAND ${{ steps.cmake_and_ninja.outputs.cmake_dir }}/ctest --verbose -j ${N}
567587
WORKING_DIRECTORY build

0 commit comments

Comments
 (0)