From cd8c8af8e85e2b077090c42f3ea9554d9f626023 Mon Sep 17 00:00:00 2001 From: Raynor Vliegendhart Date: Wed, 6 Sep 2017 07:54:32 +0200 Subject: [qt5] Do not link all .lib files This commit moves a few .lib files to subfolders to prevent them from automatically getting linked: Qt5Bootstrap (dbg): This lib is linked against a release version of the CRT and is only meant for release builds. For debug builds, this lib should not be linked at all. qtmain (rel), qtmaind (dbg), Qt5AxServer (rel), Qt5AxServerd (dbg): These libs are mutually exclusive. The user either links against qtmain(d) for desktop applications or against Qt5AxServer(d) for ActiveX servers. See https://github.com/Microsoft/vcpkg/issues/1442 for more information. --- ports/qt5/portfile.cmake | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/ports/qt5/portfile.cmake b/ports/qt5/portfile.cmake index 33709c528..4b852e95c 100644 --- a/ports/qt5/portfile.cmake +++ b/ports/qt5/portfile.cmake @@ -89,6 +89,55 @@ vcpkg_execute_required_process( vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT}) + +#--------------------------------------------------------------------------- +# Qt5Bootstrap: a release-only dependency +#--------------------------------------------------------------------------- +# Remove release-only Qt5Bootstrap.lib from debug folders: +#file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrap.lib) +#file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrap.prl) +# Above approach does not work: +# check_matching_debug_and_release_binaries(dbg_libs, rel_libs) +# requires the two sets to be of equal size! +# Alt. approach, create dummy folder instead: +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/dont-use) +file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrap.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/dont-use) +file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrap.prl DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/dont-use) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrap.lib) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5Bootstrap.prl) +#--------------------------------------------------------------------------- + +#--------------------------------------------------------------------------- +# qtmain(d) vs. Qt5AxServer(d) +#--------------------------------------------------------------------------- +# Qt applications have to either link to qtmain(d) or to Qt5AxServer(d), +# never both. See http://doc.qt.io/qt-5/activeqt-server.html for more info. +# +# Create manual-link folders: +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link) +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) +# +# Either have users explicitly link against qtmain.lib, qtmaind.lib: +file(COPY ${CURRENT_PACKAGES_DIR}/lib/qtmain.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link) +file(COPY ${CURRENT_PACKAGES_DIR}/lib/qtmain.prl DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link) +file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/qtmain.lib) +file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/qtmain.prl) +file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) +file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.prl DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.lib) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/qtmaind.prl) +# +# ... or have users explicitly link against Qt5AxServer.lib, Qt5AxServerd.lib: +file(COPY ${CURRENT_PACKAGES_DIR}/lib/Qt5AxServer.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link) +file(COPY ${CURRENT_PACKAGES_DIR}/lib/Qt5AxServer.prl DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link) +file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/Qt5AxServer.lib) +file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/Qt5AxServer.prl) +file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5AxServerd.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) +file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5AxServerd.prl DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5AxServerd.lib) +file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/Qt5AxServerd.prl) +#--------------------------------------------------------------------------- + file(INSTALL ${SOURCE_PATH}/LICENSE.LGPLv3 DESTINATION ${CURRENT_PACKAGES_DIR}/share/qt5 RENAME copyright) if(EXISTS ${CURRENT_PACKAGES_DIR}/plugins) file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/qtdeploy.ps1 DESTINATION ${CURRENT_PACKAGES_DIR}/plugins) -- cgit v1.2.3 From 304a1561cb1763bec87ac5b8bf4ac67c00680e6f Mon Sep 17 00:00:00 2001 From: Raynor Vliegendhart Date: Wed, 6 Sep 2017 08:03:45 +0200 Subject: [qt5] Bump version to reflect change in which .libs are linked --- ports/qt5/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/qt5/CONTROL b/ports/qt5/CONTROL index 01c7a3a19..704bc9ca5 100644 --- a/ports/qt5/CONTROL +++ b/ports/qt5/CONTROL @@ -1,4 +1,4 @@ Source: qt5 -Version: 5.8-4 +Version: 5.8-5 Description: Qt5 application framework main components. Webengine, examples and tests not included. Build-Depends: zlib, libjpeg-turbo, libpng, freetype, pcre, harfbuzz, sqlite3, libpq, double-conversion -- cgit v1.2.3