Skip to content

Commit

Permalink
Adjust linker flags for static build with cmake/mingw-w64
Browse files Browse the repository at this point in the history
It is not clear anymore where I picked that change up and for
what reason. Never touch a running system so let's keep it.

Change-Id: Iad665f18da5b4540f0899829a0165e1d3aa4ea60
  • Loading branch information
Martchus committed Aug 26, 2021
1 parent 7c16fa7 commit 63bab93
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/corelib/Qt5CoreConfigExtras.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,9 @@ if(NOT \"${QT_NO_CREATE_VERSIONLESS_TARGETS}\" AND NOT TARGET Qt::WinMain)
)
endif()
!!ENDIF

!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
set(_isExe $<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>)
# INTERFACE_LINK_LIBRARIES is used to pass a linker flag '-static' and library ws2_32
set_target_properties(${IMPORTED_TARGET_NAME} PROPERTIES \"INTERFACE_LINK_LIBRARIES\" \"$<${_isExe}:-static;ws2_32>\")
unset(_isExe)

0 comments on commit 63bab93

Please sign in to comment.