Skip to content

Commit f523a4b

Browse files
committed
MinGW - copy dlls on install
1 parent 6a496b8 commit f523a4b

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
@@ -299,6 +299,24 @@ if(EGIAMP_BUILD_GUI)
299299
endif()
300300
endif()
301301

302+
# =============================================================================
303+
# MinGW Runtime Deployment
304+
# Copy MinGW runtime DLLs so executables work outside the build environment
305+
# =============================================================================
306+
if(MINGW)
307+
get_filename_component(MINGW_BIN_DIR "${CMAKE_CXX_COMPILER}" DIRECTORY)
308+
set(MINGW_RUNTIME_DLLS
309+
"${MINGW_BIN_DIR}/libgcc_s_seh-1.dll"
310+
"${MINGW_BIN_DIR}/libstdc++-6.dll"
311+
"${MINGW_BIN_DIR}/libwinpthread-1.dll"
312+
)
313+
foreach(_dll ${MINGW_RUNTIME_DLLS})
314+
if(EXISTS "${_dll}")
315+
install(FILES "${_dll}" DESTINATION "${INSTALL_BINDIR}")
316+
endif()
317+
endforeach()
318+
endif()
319+
302320
# =============================================================================
303321
# macOS: Code signing
304322
# =============================================================================

0 commit comments

Comments
 (0)