From fcff201356ef00d5ef2020e7604583a6202f0b81 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Fri, 20 Sep 2013 14:14:29 +0000 Subject: [PATCH] make tests buildable both as shared and static linkage. static builds make it easier to debug --- test/Jamfile | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/test/Jamfile b/test/Jamfile index 5dc601610..752331670 100644 --- a/test/Jamfile +++ b/test/Jamfile @@ -25,6 +25,36 @@ ED25519_SOURCES = verify ; +rule link_test ( properties * ) +{ + local result ; + if shared in $(properties) + { + result += + libtorrent_test/shared ; + } + else + { + result += + libtorrent_test/static ; + } +} + +rule link_libtorrent ( properties * ) +{ + local result ; + if shared in $(properties) + { + result += + /torrent//torrent/shared/shared/on ; + } + else + { + result += + /torrent//torrent/static/static/on ; + } +} + lib libtorrent_test : # sources setup_transfer.cpp @@ -33,13 +63,13 @@ lib libtorrent_test ../ed25519/src/$(ED25519_SOURCES).c : # requirements - /torrent//torrent/shared/shared/on # this is used to determine whether # symbols are exported or imported shared:TORRENT_BUILDING_TEST_SHARED shared:ED25519_BUILD_DLL ../ed25519/src windows:advapi32 + @link_libtorrent : # default build shared @@ -53,12 +83,13 @@ lib advapi32 : : Advapi32 ; project : requirements main.cpp - /torrent//torrent/shared/shared/on - libtorrent_test/shared + @link_test + @link_libtorrent : default-build multi full on + shared ; feature launcher : none valgrind : composite ;