attempt to make shared library builds to work with visibility=hidden

This commit is contained in:
Arvid Norberg
2012-03-15 06:08:08 +00:00
parent 7f2d6325df
commit 7b1a441aeb
7 changed files with 42 additions and 20 deletions

View File

@@ -5,6 +5,7 @@ set(sources
web_connection_base
alert
allocator
asio
assert
bandwidth_limit
bandwidth_manager
@@ -142,6 +143,7 @@ else (dht)
endif (dht)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -fvisibility-inlines-hidden")
if (shared)
add_library(torrent-rasterbar SHARED ${sources2})
@@ -157,7 +159,7 @@ include_directories(${Boost_INCLUDE_DIR})
target_link_libraries(torrent-rasterbar ${Boost_LIBRARIES})
# this works around a bug in asio in boost-1.39
add_definitions(-DBOOST_ASIO_HASH_MAP_BUCKETS=1021)
add_definitions(-DBOOST_ASIO_HASH_MAP_BUCKETS=1021 -DBOOST_ASIO_DYN_LINK)
if (WIN32)
target_link_libraries(torrent-rasterbar wsock32 ws2_32)