From ef96868b87e55935792f392dd5881d49bc672ce5 Mon Sep 17 00:00:00 2001 From: Foxyz Date: Sat, 10 Oct 2026 00:31:25 +0300 Subject: [PATCH] 0.1.9: Windows build fix (D8021: '/W3 /WX' as one cl argument) Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 6 ++++++ pubspec.yaml | 2 +- windows/CMakeLists.txt | 15 ++++++--------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75aeb15..2123684 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.1.9 + +* Windows: the plugin builds again. Its per-source compile options passed + "/W3 /WX" to cl.exe as one argument (error D8021); now plain /W3 for all + sources, without warnings-as-errors. + ## 0.1.8 * Linux, debug builds only: a Flutter hot restart no longer crashes apps that diff --git a/pubspec.yaml b/pubspec.yaml index bdc3689..9962477 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: fox_utils description: A collection of reusable Flutter widgets and extensions. -version: 0.1.8 +version: 0.1.9 environment: sdk: ^3.9.2 diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt index 5ddc42e..82fe850 100644 --- a/windows/CMakeLists.txt +++ b/windows/CMakeLists.txt @@ -19,15 +19,12 @@ target_include_directories(${PLUGIN_NAME} INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include") target_link_libraries(${PLUGIN_NAME} PRIVATE flutter flutter_wrapper_plugin) -# GdiPlus doesn't compile with /W4 warning level; strict flags are scoped to -# this package's own sources. The vendored desktop_drop engine is compiled -# as upstream ships it (no warnings-as-errors) since it is not ours to churn. -set_source_files_properties("fox_utils_plugin.cpp" "pasteboard_plugin.cpp" - PROPERTIES COMPILE_OPTIONS - "$<$:/W3 /WX>;$<$>:-Wall -Wextra -Wpedantic -Werror>") -set_source_files_properties("desktop_drop_plugin.cpp" - PROPERTIES COMPILE_OPTIONS - "$<$:/W3>") +# GdiPlus doesn't compile with /W4 (the template's level): all sources use +# /W3, one option per list entry ("/W3 /WX" in one entry reaches cl.exe as a +# single bad argument, D8021). No warnings-as-errors: a newer MSVC's new +# warning must not break app releases. +set_source_files_properties("fox_utils_plugin.cpp" "pasteboard_plugin.cpp" "desktop_drop_plugin.cpp" + PROPERTIES COMPILE_OPTIONS "/W3") # List of absolute paths to libraries that should be bundled with the plugin set(fox_utils_bundled_libraries