From 7011ba1551996ca8148a2d77958cef385cac82f3 Mon Sep 17 00:00:00 2001 From: Rust Date: Wed, 29 Oct 2025 16:57:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20/FS=20=E6=A0=87=E5=BF=97?= =?UTF-8?q?=E6=9D=A5=E5=85=81=E8=AE=B8=E5=A4=9A=E4=B8=AA=20CL.EXE=20?= =?UTF-8?q?=E8=BF=9B=E7=A8=8B=E5=86=99=E5=85=A5=E5=90=8C=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=20PDB=20=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit c12510cbdea34463b411858a0034c52e6ded5c5f) --- windows/CMakeLists.txt | 8 ++++++++ windows/flutter/generated_plugins.cmake | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt index 5e69f31..1f2c994 100755 --- a/windows/CMakeLists.txt +++ b/windows/CMakeLists.txt @@ -78,6 +78,14 @@ add_subdirectory("runner") # them to the application. include(flutter/generated_plugins.cmake) +# 为所有插件应用 /FS 标志,解决 PDB 文件锁冲突问题 +# 这确保 flutter_inappwebview_windows 等插件能够正确编译 +foreach(plugin ${FLUTTER_PLUGIN_LIST}) + if(TARGET ${plugin}_plugin) + target_compile_options(${plugin}_plugin PRIVATE /FS) + endif() +endforeach(plugin) + # === Installation === # Support files are copied into place next to the executable, so that it can diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index 1101ef7..8844be2 100755 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -24,6 +24,10 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) + # 为每个插件目标应用 /FS 编译选项,解决并行编译时的 PDB 锁冲突 + if(TARGET ${plugin}_plugin) + target_compile_options(${plugin}_plugin PRIVATE /FS) + endif() endforeach(plugin) foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})