Skip to content

Commit 3e94ae3

Browse files
Using CMake InstallRequiredSystemLibraries module to bundle the correct MSVC runtime
1 parent 261e53b commit 3e94ae3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/serious_python_windows/windows/CMakeLists.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,14 @@ list(APPEND PLUGIN_SOURCES
3131
)
3232

3333
if(MSVC)
34-
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
34+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
35+
set(CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY $<IF:$<CONFIG:Debug>,ON,OFF>)
36+
file(REAL_PATH ${CMAKE_BINARY_DIR}/runner/$<CONFIG> FLUTTER_APP_DIR)
37+
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION ${FLUTTER_APP_DIR})
3538
endif()
3639

40+
include(InstallRequiredSystemLibraries)
41+
3742
# Define the plugin library target. Its name must not be changed (see comment
3843
# on PLUGIN_NAME above).
3944
add_library(${PLUGIN_NAME} SHARED
@@ -75,9 +80,6 @@ target_link_libraries(${PLUGIN_NAME} PRIVATE
7580
set(serious_python_windows_bundled_libraries
7681
"${PYTHON_PACKAGE}/python312$<$<CONFIG:Debug>:_d>.dll"
7782
"${PYTHON_PACKAGE}/python3$<$<CONFIG:Debug>:_d>.dll"
78-
# "$ENV{WINDIR}/system32/msvcp140.dll"
79-
# "$ENV{WINDIR}/system32/vcruntime140.dll"
80-
# "$ENV{WINDIR}/system32/vcruntime140_1.dll"
8183
PARENT_SCOPE
8284
)
8385

0 commit comments

Comments
 (0)