From bf2176645bf2469f21a09716951715c0475f35e7 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sat, 10 Oct 2026 22:37:40 +0200 Subject: [PATCH] Pass /EHsc to the Windows C++20 module build ci_module_cpp20 now forwards CMAKE_CXX_FLAGS to the module build. The Windows workflow sets CMAKE_CXX_FLAGS, which replaces CMake's MSVC defaults including /EHsc, so failed with C4530 under /WX. Signed-off-by: Niels Lohmann --- .github/workflows/windows.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d906752a0..0ac496124 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -217,8 +217,10 @@ jobs: uses: lukka/get-cmake@fffaaafeea488556c2c12dad60690008bc1caacb # v4.4.2 with: cmakeVersion: 4.3.4 + # CMAKE_CXX_FLAGS replaces CMake's MSVC defaults (which include /EHsc), and + # ci_module_cpp20 forwards it to the module build, so list /EHsc explicitly - name: Run CMake (Debug) - run: cmake -S . -B build -G "Visual Studio 17 2022" -DJSON_CI=ON -DCMAKE_CXX_FLAGS="/permissive- /std:c++latest /utf-8 /W4 /WX" + run: cmake -S . -B build -G "Visual Studio 17 2022" -DJSON_CI=ON -DCMAKE_CXX_FLAGS="/permissive- /std:c++latest /utf-8 /EHsc /W4 /WX" - name: Build run: cmake --build build --config Debug --target ci_module_cpp20 \ No newline at end of file