fix windows not copy library bug

This commit is contained in:
alves
2025-12-08 17:00:20 +08:00
parent 4b80ffe2e0
commit b6e4d1a682
2 changed files with 13 additions and 8 deletions

View File

@@ -808,7 +808,8 @@ function(Snapmaker_Orca_copy_dlls target config postfix output_dlls)
${CMAKE_PREFIX_PATH}/bin/freetype.dll ${CMAKE_PREFIX_PATH}/bin/freetype.dll
DESTINATION ${_out_dir}) DESTINATION ${_out_dir})
set(${output_dlls} # Build the DLL list in a local variable first
set(_dll_list
${_out_dir}/libgmp-10.dll ${_out_dir}/libgmp-10.dll
${_out_dir}/libmpfr-4.dll ${_out_dir}/libmpfr-4.dll
${_out_dir}/WebView2Loader.dll ${_out_dir}/WebView2Loader.dll
@@ -841,20 +842,19 @@ function(Snapmaker_Orca_copy_dlls target config postfix output_dlls)
${_out_dir}/TKXSBase.dll ${_out_dir}/TKXSBase.dll
${_out_dir}/freetype.dll ${_out_dir}/freetype.dll
PARENT_SCOPE
) )
# Add Sentry DLLs to the output list if Sentry is enabled # Add Sentry DLLs to the list if Sentry is enabled
if (SLIC3R_SENTRY) if (SLIC3R_SENTRY)
set(${output_dlls} list(APPEND _dll_list
${${output_dlls}}
${_out_dir}/sentry.dll ${_out_dir}/sentry.dll
${_out_dir}/crashpad_handler.exe ${_out_dir}/crashpad_handler.exe
PARENT_SCOPE
) )
endif() endif()
# Set the output variable in parent scope (only once, with complete list)
set(${output_dlls} ${_dll_list} PARENT_SCOPE)
endfunction() endfunction()

View File

@@ -226,8 +226,13 @@ if (WIN32)
foreach (CONF ${CMAKE_CONFIGURATION_TYPES}) foreach (CONF ${CMAKE_CONFIGURATION_TYPES})
if ("${CONF}" STREQUAL "Debug") if ("${CONF}" STREQUAL "Debug")
Snapmaker_Orca_copy_dlls(COPY_DLLS "${CONF}" "d" output_dlls_Debug) Snapmaker_Orca_copy_dlls(COPY_DLLS "${CONF}" "d" output_dlls_Debug)
else() elseif ("${CONF}" STREQUAL "Release")
Snapmaker_Orca_copy_dlls(COPY_DLLS "${CONF}" "" output_dlls_Release) Snapmaker_Orca_copy_dlls(COPY_DLLS "${CONF}" "" output_dlls_Release)
elseif ("${CONF}" STREQUAL "RelWithDebInfo")
Snapmaker_Orca_copy_dlls(COPY_DLLS "${CONF}" "" output_dlls_RelWithDebInfo)
else()
# MinSizeRel or other configs
Snapmaker_Orca_copy_dlls(COPY_DLLS "${CONF}" "" _unused_dlls)
endif() endif()
endforeach () endforeach ()
else () else ()