diff --git a/CMakeLists.txt b/CMakeLists.txt index 6123cc91..8aa5c62a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,6 +103,7 @@ if (MINGW) # Remove cmd window when executing planetblupi set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -mwindows") + set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive") endif (MINGW) # Dependencies @@ -282,14 +283,6 @@ if (NOT USE_APPIMAGE) ) endif () -# Copy libwinpthread-1.dll which seems not be linkable statically -if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND MINGW) - execute_process (COMMAND cygpath.exe --windows $ENV{MINGW_PREFIX} OUTPUT_VARIABLE MINGW_PATH) - string (REGEX REPLACE "[ \t\n\r]+$" "" MINGW_PATH "${MINGW_PATH}") - string (REGEX REPLACE "[\\]" "\\\\\\\\" MINGW_PATH "${MINGW_PATH}") - install (FILES "${MINGW_PATH}\\\\bin\\\\libwinpthread-1.dll" DESTINATION bin) -endif () - ######### ## Deploy #########