cmake: transitive deps and remove deprecated LINK_*

Keep the immediate direct deps at the library that depends on them,
declare deps as PUBLIC so that targets that link against that library
get the library's deps as transitive deps.

Break dep cycle between blockchain_db <-> crytonote_core.
No code refactoring, just hide cycle from cmake so that
it doesn't complain (cycles are allowed only between
static libs, not shared libs).

This is in preparation for supproting BUILD_SHARED_LIBS cmake
built-in option for building internal libs as shared.
This commit is contained in:
redfish 2016-09-17 13:59:29 -04:00
parent 54010b97b4
commit e1c7af35d4
29 changed files with 101 additions and 114 deletions

View file

@ -32,16 +32,10 @@ project (bitmonero CXX)
file(GLOB CRYPTONOTE_PROTOCOL *)
source_group(cryptonote_protocol FILES ${CRYPTONOTE_PROTOCOL})
#add_library(p2p ${P2P})
#bitmonero_private_headers(p2p ${CRYPTONOTE_PROTOCOL})
#bitmonero_private_headers(cryptonote_protocol ${CRYPTONOTE_PROTOCOL})
bitmonero_add_library(cryptonote_protocol ${CRYPTONOTE_PROTOCOL})
#target_link_libraries(p2p)
# LINK_PRIVATE
# ${Boost_CHRONO_LIBRARY}
# ${Boost_REGEX_LIBRARY}
# ${Boost_SYSTEM_LIBRARY}
# ${Boost_THREAD_LIBRARY}
# ${EXTRA_LIBRARIES})
target_link_libraries(cryptonote_protocol
PRIVATE
${EXTRA_LIBRARIES})
add_dependencies(cryptonote_protocol
version)