aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2020-01-15 16:35:04 -0800
committerVictor Romero <romerosanchezv@gmail.com>2020-01-15 16:35:04 -0800
commit562515f3281b745ac18062499ff8f5147f021fce (patch)
treefc7009af5e673776dd7d0db44c8c01050267d3bf
parent2dde9fb51482f7d7609f83172d23302974dfcf37 (diff)
downloadvcpkg-562515f3281b745ac18062499ff8f5147f021fce.tar.gz
vcpkg-562515f3281b745ac18062499ff8f5147f021fce.zip
[libtorrent] Fix linkage issues for dynamic builds (#7345)
* [libtorrent] Fix linkage issues for dynamic builds * [libtorrent] Also handle static linkage Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
-rw-r--r--ports/libtorrent/CONTROL2
-rw-r--r--ports/libtorrent/portfile.cmake13
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)