TORRENT_DEBUG and -fvisibility=hidden fix for CMakeLists.txt

This commit is contained in:
Arvid Norberg 2008-12-28 23:07:46 +00:00
parent 7c3fdc2c2d
commit c3e49e4ca2
1 changed files with 10 additions and 0 deletions

View File

@ -101,6 +101,15 @@ option(deprecated-functions "enable deprecated functions for backwards compatibi
option(build_tests "build tests" ON)
option(build_examples "build examples" ON)
set(CMAKE_CONFIGURATION_TYPES Debug Release RelWithDebInfo)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release FORCE)
endif (NOT CMAKE_BUILD_TYPE)
# add_definitions() doesn't seem to let you say wich build type to apply it to
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DTORRENT_DEBUG")
if (encryption)
list(APPEND sources pe_crypto)
endif (encryption)
@ -121,6 +130,7 @@ else (dht)
endif (dht)
if (shared)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
add_library(torrent-rasterbar SHARED ${sources2} ${zlib_sources2})
else (shared)
add_library(torrent-rasterbar STATIC ${sources2} ${zlib_sources2})