use -fvisibility=hidden for darwin and gcc toolkits

This commit is contained in:
Arvid Norberg 2008-12-20 21:12:39 +00:00
parent 4bd0d2d2e6
commit 3d34d30afb
2 changed files with 39 additions and 13 deletions

32
Jamfile
View File

@ -110,22 +110,29 @@ rule linking ( properties * )
{
if <boost-link>static in $(properties)
{
result += <library>/boost/thread//boost_thread/<link>static
<library>/boost/filesystem//boost_filesystem/<link>static
<library>/boost/system//boost_system/<link>static
<include>$(BOOST_ROOT)
<define>BOOST_ALL_NO_LIB
;
if <toolset>darwin in $(properties) || <toolset>gcc in $(properties)
{
result += <library>/boost/thread//boost_thread/<link>static/<cflags>-fvisibility=hidden
<library>/boost/filesystem//boost_filesystem/<link>static/<cflags>-fvisibility=hidden
<library>/boost/system//boost_system/<link>static
#/<cflags>-fvisibility=hidden
;
}
else
{
result += <library>/boost/thread//boost_thread/<link>static
<library>/boost/filesystem//boost_filesystem/<link>static
<library>/boost/system//boost_system/<link>static
;
}
}
else
{
result += <library>/boost/thread//boost_thread/<link>shared
<library>/boost/filesystem//boost_filesystem/<link>shared
<library>/boost/system//boost_system/<link>shared
<include>$(BOOST_ROOT)
<define>BOOST_ALL_NO_LIB
;
<library>/boost/system//boost_system/<link>shared ;
}
result += <include>$(BOOST_ROOT) <define>BOOST_ALL_NO_LIB ;
}
if <boost>system in $(properties)
@ -146,6 +153,11 @@ rule building ( properties * )
{
local result ;
if <toolset>gcc in $(properties) || <toolset>darwin in $(properties)
{
result += <cflags>-fvisibility=hidden ;
}
if ( <target-os>linux in $(properties)
|| <target-os>darwin in $(properties) )
&& ( <toolset>gcc in $(properties)

View File

@ -2,7 +2,7 @@ import python ;
use-project /torrent : ../.. ;
lib boost_python : : <name>boost_python $(library-search-path) ;
lib boost_python : : <name>boost_python-mt $(library-search-path) ;
rule libtorrent_linking ( properties * )
{
@ -10,13 +10,28 @@ rule libtorrent_linking ( properties * )
if <toolset>gcc in $(properties)
{
result += <library>/torrent//torrent/<link>static/<cxxflags>-fPIC/<cflags>-fPIC <cxxflags>-fPIC ;
result += <library>/torrent//torrent/<link>static/<cflags>-fPIC
<cflags>-fPIC ;
}
else
{
result += <library>/torrent//torrent/<link>static ;
}
if <toolset>gcc in $(properties) || <toolset>darwin in $(properties)
{
result += <cflags>-fvisibility=hidden ;
if <boost>source in $(properties) && <boost-link>static in $(properties)
{
result += <library>/boost/python//boost_python/<link>static/<cflags>-fvisibility=hidden ;
}
}
else if <boost>source in $(properties) && <boost-link>static in $(properties)
{
result += <library>/boost/python//boost_python/<link>static ;
}
# when building peer_plugin.cpp on msvc-7.1 it fails
# running out of internal heap space. Don't add it
# to windows build, since it's not critical anyway
@ -54,7 +69,6 @@ python-extension libtorrent
src/magnet_uri.cpp
: <include>src
<boost>system:<library>boost_python
<boost>source,<boost-link>static:<library>/boost/python//boost_python/<link>static
<boost>source,<boost-link>shared:<library>/boost/python//boost_python/<link>shared
<conditional>@libtorrent_linking
;