fix: copy runtime DLLs for Ninja generator on Windows

The runtime DLL copy was nested under CMAKE_CONFIGURATION_TYPES, so it only ran
for multi-config generators.

Ninja single-config leaves that variable empty, which skipped copying OCCT,
GMP, MPFR, WebView2, and freetype DLLs next to the executable. Run the copy
logic for both generator styles while keeping it Windows-only.
This commit is contained in:
Gabriel
2026-06-24 00:36:59 -03:00
parent 0a7ac3f2ac
commit 08128911e3

View File

@@ -212,14 +212,6 @@ if (WIN32)
VERBATIM
)
endforeach ()
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
orcaslicer_copy_dlls(COPY_DLLS "Debug" "d" output_dlls_Debug)
elseif("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
orcaslicer_copy_dlls(COPY_DLLS "RelWithDebInfo" "" output_dlls_Release)
else()
orcaslicer_copy_dlls(COPY_DLLS "Release" "" output_dlls_Release)
endif()
else ()
file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}/resources" WIN_RESOURCES_SYMLINK)
add_custom_command(TARGET OrcaSlicer POST_BUILD
@@ -229,6 +221,27 @@ if (WIN32)
)
endif ()
if (CMAKE_CONFIGURATION_TYPES)
# Multi-config generators (Visual Studio, Ninja Multi-Config): copy per config.
foreach (cfg ${CMAKE_CONFIGURATION_TYPES})
if ("${cfg}" STREQUAL "Debug")
orcaslicer_copy_dlls(COPY_DLLS "Debug" "d" output_dlls_Debug)
elseif("${cfg}" STREQUAL "RelWithDebInfo")
orcaslicer_copy_dlls(COPY_DLLS "RelWithDebInfo" "" output_dlls_RelWithDebInfo)
else()
orcaslicer_copy_dlls(COPY_DLLS "${cfg}" "" output_dlls_${cfg})
endif()
endforeach()
else()
# Single-config generators (Ninja): use CMAKE_BUILD_TYPE.
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
orcaslicer_copy_dlls(COPY_DLLS "Debug" "d" output_dlls_Debug)
elseif("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
orcaslicer_copy_dlls(COPY_DLLS "RelWithDebInfo" "" output_dlls_RelWithDebInfo)
else()
orcaslicer_copy_dlls(COPY_DLLS "Release" "" output_dlls_Release)
endif()
endif()
else ()
if (APPLE AND NOT CMAKE_MACOSX_BUNDLE)