From 4a71284b78371ece581d6219863444922256ea1c Mon Sep 17 00:00:00 2001 From: Jiwoo Park Date: Sat, 20 Jan 2024 05:12:13 +0900 Subject: [PATCH] Fix ASan issue on Windows workflow --- .github/workflows/ci.yaml | 23 +++++++++++++++++------ cmake/preset/base.json | 8 ++++++++ cmake/preset/windows.json | 24 ++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fd4979c..42a58b2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - preset: [linux-clang, linux-gcc, macos, windows] + preset: [linux-clang, linux-gcc, macos, windows-ninja] config: [Debug, Release] abstract: [OFF, ON] sanitize: [address, thread, undefined, leak, memory] @@ -16,15 +16,15 @@ jobs: - { preset: linux-gcc, sanitize: memory } - { preset: macos, sanitize: leak } - { preset: macos, sanitize: memory } - - { preset: windows, sanitize: thread } - - { preset: windows, sanitize: undefined } - - { preset: windows, sanitize: leak } - - { preset: windows, sanitize: memory } + - { preset: windows-ninja, sanitize: thread } + - { preset: windows-ninja, sanitize: undefined } + - { preset: windows-ninja, sanitize: leak } + - { preset: windows-ninja, sanitize: memory } include: - { preset: linux-clang, os: ubuntu-latest } - { preset: linux-gcc, os: ubuntu-latest } - { preset: macos, os: macos-latest } - - { preset: windows, os: windows-latest } + - { preset: windows-ninja, os: windows-latest } runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -34,6 +34,17 @@ jobs: run: | sudo apt-get update sudo apt-get install -y ninja-build + - name: Install dependencies on Windows + if: runner.os == 'Windows' + run: | + choco install ninja + + - name: Choose the latest MSVC toolset + if: runner.os == 'Windows' + uses: TheMrMilchmann/setup-msvc-dev@v3 + with: + arch: x64 + toolset: 14.38 - name: Configure run: > diff --git a/cmake/preset/base.json b/cmake/preset/base.json index a96b78b..38a30eb 100644 --- a/cmake/preset/base.json +++ b/cmake/preset/base.json @@ -188,6 +188,14 @@ "CMAKE_C_COMPILER": "gcc", "CMAKE_CXX_COMPILER": "g++" } + }, + { + "name": "msvc", + "hidden": true, + "cacheVariables": { + "CMAKE_C_COMPILER": "cl", + "CMAKE_CXX_COMPILER": "cl" + } } ], "buildPresets": [ diff --git a/cmake/preset/windows.json b/cmake/preset/windows.json index 626e614..e737faa 100644 --- a/cmake/preset/windows.json +++ b/cmake/preset/windows.json @@ -13,6 +13,15 @@ "default" ] }, + { + "name": "windows-ninja", + "inherits": [ + "host-windows", + "target-windows", + "ninja", + "default" + ] + }, { "name": "windows-arm", "inherits": [ @@ -58,6 +67,13 @@ "host-windows" ] }, + { + "name": "windows-ninja", + "configurePreset": "windows-ninja", + "inherits": [ + "host-windows" + ] + }, { "name": "windows-arm", "configurePreset": "windows-arm", @@ -96,6 +112,14 @@ "options" ] }, + { + "name": "windows-ninja", + "configurePreset": "windows-ninja", + "inherits": [ + "host-windows", + "options" + ] + }, { "name": "windows-arm", "configurePreset": "windows-arm",