From 1861cc486295329575979d1c525b97444f3a7db0 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 25 Aug 2026 23:06:37 +0000 Subject: [PATCH] fix(windows): unblock release build on MSVC 14.51 coroutine hard error `flutter build windows --release` failed on every attempt with STL1011: experimental/coroutine(37,1): error C2338: static assertion failed: 'error STL1011: The /await compiler option, , ... are deprecated by Microsoft and will be REMOVED SOON.' MSVC 14.51 (Visual Studio 2026) promoted that deprecation to a hard static_assert. Two plugins still reach the experimental header through C++/WinRT: - flutter_inappwebview_windows compiles as C++17, so __cpp_lib_coroutine is undefined and falls back to . - permission_handler_windows builds with /await, which selects the experimental coroutine machinery outright. Neither plugin is editable here; both are regenerated under flutter/ephemeral/.plugin_symlinks by `flutter pub get`. The opt-out Microsoft documents in the error is therefore set at the top of the app-level windows/CMakeLists.txt, ahead of the plugin subdirectories, so it propagates to every plugin target -- including flutter_inappwebview_windows, which deliberately does not call apply_standard_settings. Also point the Inno Setup shortcuts at the binary CMake actually emits (BINARY_NAME is "OpenlibExtended"). NTFS resolved the old casing case-insensitively, so this was latent rather than fatal. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01XT2zu1qt8pzup93eT2FyG9 --- .github/workflows/build.yml | 6 +++--- windows/CMakeLists.txt | 10 ++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8343f5b..2a7897e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -249,10 +249,10 @@ jobs: [Files] Source: "build\windows\x64\runner\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs [Icons] - Name: "{group}\OpenLibExtended"; Filename: "{app}\OpenLibExtended.exe" - Name: "{autodesktop}\OpenLibExtended"; Filename: "{app}\OpenLibExtended.exe" + Name: "{group}\OpenLibExtended"; Filename: "{app}\OpenlibExtended.exe" + Name: "{autodesktop}\OpenLibExtended"; Filename: "{app}\OpenlibExtended.exe" [Run] - Filename: "{app}\OpenLibExtended.exe"; Description: "Launch OpenLibExtended"; Flags: nowait postinstall skipifsilent + Filename: "{app}\OpenlibExtended.exe"; Description: "Launch OpenLibExtended"; Flags: nowait postinstall skipifsilent "@ | Out-File -FilePath "installer.iss" -Encoding UTF8 mkdir artifacts & "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" installer.iss diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt index ed0208d..2038013 100644 --- a/windows/CMakeLists.txt +++ b/windows/CMakeLists.txt @@ -32,6 +32,16 @@ set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") # Use Unicode for all projects. add_definitions(-DUNICODE -D_UNICODE) +# MSVC 14.51 (Visual Studio 2026) promoted the +# deprecation to a hard error (STL1011). Two plugins still reach that header +# through C++/WinRT: flutter_inappwebview_windows compiles as C++17, so +# falls back to the experimental header, and +# permission_handler_windows builds with /await, which selects the experimental +# coroutine machinery outright. Both are regenerated under +# flutter/ephemeral/.plugin_symlinks by `flutter pub get`, so the opt-out is set +# here, ahead of the plugin subdirectories below, to reach every plugin target. +add_definitions(-D_SILENCE_EXPERIMENTAL_COROUTINE_DEPRECATION_WARNINGS) + # Compilation settings that should be applied to most targets. # # Be cautious about adding new options here, as plugins use this function by