From 562515f3281b745ac18062499ff8f5147f021fce Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Wed, 15 Jan 2020 16:35:04 -0800 Subject: [libtorrent] Fix linkage issues for dynamic builds (#7345) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [libtorrent] Fix linkage issues for dynamic builds * [libtorrent] Also handle static linkage Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> --- ports/libtorrent/CONTROL | 2 +- ports/libtorrent/portfile.cmake | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/ports/libtorrent/CONTROL b/ports/libtorrent/CONTROL index 3c3f3ec2b..08964ba96 100644 --- a/ports/libtorrent/CONTROL +++ b/ports/libtorrent/CONTROL @@ -1,5 +1,5 @@ Source: libtorrent -Version: 1.2.2 +Version: 1.2.2-1 Homepage: https://github.com/arvidn/libtorrent Description: An efficient feature complete C++ BitTorrent implementation Build-Depends: openssl, boost-system, boost-date-time, boost-chrono, boost-random, boost-asio, boost-crc, boost-config, boost-iterator, boost-scope-exit, boost-multiprecision diff --git a/ports/libtorrent/portfile.cmake b/ports/libtorrent/portfile.cmake index a9b88fe89..752a8f217 100644 --- a/ports/libtorrent/portfile.cmake +++ b/ports/libtorrent/portfile.cmake @@ -10,24 +10,23 @@ vcpkg_from_github( add-datetime-to-boost-libs.patch ) -string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" LIBTORRENT_SHARED) - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA # Disable this option if project cannot be built with Ninja OPTIONS - -Dshared=${LIBTORRENT_SHARED} -Ddeprecated-functions=off ) vcpkg_install_cmake() +file(READ ${CURRENT_PACKAGES_DIR}/include/libtorrent/aux_/export.hpp EXPORT_H) +string(REPLACE "defined TORRENT_BUILDING_SHARED" "0" EXPORT_H "${EXPORT_H}") if (VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - # Defines for shared lib - file(READ ${CURRENT_PACKAGES_DIR}/include/libtorrent/aux_/export.hpp EXPORT_H) - string(REPLACE "defined TORRENT_BUILDING_SHARED" "1" EXPORT_H "${EXPORT_H}") - file(WRITE ${CURRENT_PACKAGES_DIR}/include/libtorrent/aux_/export.hpp "${EXPORT_H}") + string(REPLACE "defined TORRENT_LINKING_SHARED" "1" EXPORT_H "${EXPORT_H}") +else() + string(REPLACE "defined TORRENT_LINKING_SHARED" "0" EXPORT_H "${EXPORT_H}") endif() +file(WRITE ${CURRENT_PACKAGES_DIR}/include/libtorrent/aux_/export.hpp "${EXPORT_H}") vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/LibtorrentRasterbar TARGET_PATH share/libtorrentrasterbar) -- cgit v1.2.3