Skip to content

Commit 9d0d4c5

Browse files
committed
MINGW - copy dlls on install
1 parent b69e24f commit 9d0d4c5

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,24 @@ if(LSLTEMPLATE_BUILD_GUI)
340340
endif()
341341
endif()
342342

343+
# =============================================================================
344+
# MinGW Runtime Deployment
345+
# Copy MinGW runtime DLLs so executables work outside the build environment
346+
# =============================================================================
347+
if(MINGW)
348+
get_filename_component(MINGW_BIN_DIR "${CMAKE_CXX_COMPILER}" DIRECTORY)
349+
set(MINGW_RUNTIME_DLLS
350+
"${MINGW_BIN_DIR}/libgcc_s_seh-1.dll"
351+
"${MINGW_BIN_DIR}/libstdc++-6.dll"
352+
"${MINGW_BIN_DIR}/libwinpthread-1.dll"
353+
)
354+
foreach(_dll ${MINGW_RUNTIME_DLLS})
355+
if(EXISTS "${_dll}")
356+
install(FILES "${_dll}" DESTINATION "${INSTALL_BINDIR}")
357+
endif()
358+
endforeach()
359+
endif()
360+
343361
# =============================================================================
344362
# macOS: Code Sign
345363
# This runs after Qt deployment. We sign the entire bundle with entitlements.

0 commit comments

Comments
 (0)