extend link compatibility check to export-extra configurations (#876)

extend link compatibility check to export-extra configurations
This commit is contained in:
Arvid Norberg 2016-07-03 11:42:57 -04:00 committed by GitHub
parent 777a0838ce
commit 33117ce5b2
8 changed files with 27 additions and 18 deletions

16
Jamfile
View File

@ -308,15 +308,6 @@ rule building ( properties * )
{
local result ;
if <link>shared in $(properties) && <export-extra>on in $(properties)
{
# export some internal libtorrent functions
# in order to me able to unit test them.
# this is off by default to keep the export
# symbol table reasonably small
result += <define>TORRENT_EXPORT_EXTRA ;
}
if <toolset>msvc in $(properties)
{
# allow larger .obj files (with more sections)
@ -503,6 +494,11 @@ feature.compose <profile-calls>on : <define>TORRENT_PROFILE_CALLS=1 ;
# controls whether or not to export some internal
# libtorrent functions. Used for unit testing
feature export-extra : off on : composite propagated ;
# export some internal libtorrent functions
# in order to me able to unit test them.
# this is off by default to keep the export
# symbol table reasonably small
feature.compose <export-extra>on : <define>TORRENT_EXPORT_EXTRA ;
# this is a trick to get filename paths to targets to become shorter
@ -741,7 +737,6 @@ local usage-requirements =
# disable bogus deprecation warnings on msvc8
<toolset>msvc:<define>_SCL_SECURE_NO_DEPRECATE
<toolset>msvc:<define>_CRT_SECURE_NO_DEPRECATE
<logging>off:<define>TORRENT_DISABLE_LOGGING
<cxxflags>$(CXXFLAGS)
<linkflags>$(LDFLAGS)
@ -781,6 +776,7 @@ lib torrent
: # usage requirements
$(usage-requirements)
<link>shared:<define>TORRENT_LINKING_SHARED
;
headers = [ path.glob-tree include/libtorrent : *.hpp ] ;

View File

@ -51,7 +51,7 @@ namespace libtorrent { namespace aux
struct TORRENT_EXTRA_EXPORT session_settings
{
friend void libtorrent::save_settings_to_dict(
friend TORRENT_EXTRA_EXPORT void libtorrent::save_settings_to_dict(
aux::session_settings const& s, entry::dictionary_type& sett);
void set_str(int name, std::string const& value)

View File

@ -53,9 +53,20 @@ POSSIBILITY OF SUCH DAMAGE.
#define TORRENT_CFG_DEPR deprecated_
#endif
#if defined TORRENT_EXPORT_EXTRA
#if TORRENT_USE_ASSERTS
#define TORRENT_CFG_ASSERTS asserts_
#else
#define TORRENT_CFG_ASSERTS noasserts_
#endif
#else
#define TORRENT_CFG_ASSERTS
#endif
#define TORRENT_CFG \
BOOST_PP_CAT(TORRENT_CFG_IPV6, \
TORRENT_CFG_DEPR)
BOOST_PP_CAT(TORRENT_CFG_DEPR, \
TORRENT_CFG_ASSERTS))
#define TORRENT_CFG_STRING BOOST_PP_STRINGIZE(TORRENT_CFG)

View File

@ -176,7 +176,7 @@ namespace libtorrent
namespace libtorrent
{
#if TORRENT_USE_ASSERTS
struct single_threaded
struct TORRENT_EXTRA_EXPORT single_threaded
{
single_threaded(): m_id() {}
~single_threaded() { m_id = std::thread::id(); }

View File

@ -83,7 +83,7 @@ namespace libtorrent
//
struct TORRENT_EXPORT settings_pack
{
friend void apply_pack(settings_pack const* pack, aux::session_settings& sett, aux::session_impl* ses);
friend TORRENT_EXTRA_EXPORT void apply_pack(settings_pack const* pack, aux::session_settings& sett, aux::session_impl* ses);
void set_str(int name, std::string val);
void set_int(int name, int val);

View File

@ -69,7 +69,7 @@ namespace libtorrent
template <typename T>
//#error boost::enable_if< is_base<T, tailqueue_node<T> > >
struct TORRENT_EXTRA_EXPORT tailqueue
struct tailqueue
{
tailqueue(): m_first(nullptr), m_last(nullptr), m_size(0) {}

View File

@ -9,7 +9,8 @@ use-project /libsimulator : libsimulator ;
project
: requirements
<simulator>on
<library>/torrent//torrent/<export-extra>on
<export-extra>on
<library>/torrent//torrent
<library>/libtorrent_test//libtorrent_test
<source>setup_swarm.cpp
<source>setup_dht.cpp

View File

@ -44,12 +44,12 @@ rule link_libtorrent ( properties * )
if <link>shared in $(properties)
{
result +=
<library>/torrent//torrent/<link>shared/<boost-link>shared/<export-extra>on ;
<library>/torrent//torrent/<link>shared/<boost-link>shared ;
}
else
{
result +=
<library>/torrent//torrent/<link>static/<boost-link>static/<export-extra>on ;
<library>/torrent//torrent/<link>static/<boost-link>static ;
}
return $(result) ;
}
@ -102,6 +102,7 @@ project
# disable warning C4275: non DLL-interface classkey 'identifier' used as base for DLL-interface classkey 'identifier'
<toolset>msvc:<cflags>/wd4275
<toolset>msvc:<define>_SCL_SECURE_NO_WARNINGS
<export-extra>on
: default-build
<threading>multi
<asserts>on