From 54010b97b4739c50f32b3364a88a452625aa31c4 Mon Sep 17 00:00:00 2001 From: redfish Date: Sun, 18 Sep 2016 02:54:30 -0400 Subject: crypto: armv7: slow-hash: remove redundant source include aesb.c is already present in libcrypto as a standalone object. Tested: builds and runs fine on armv7, static and dynamic. --- src/crypto/slow-hash.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/crypto/slow-hash.c b/src/crypto/slow-hash.c index 90fda3470..2ac303a36 100644 --- a/src/crypto/slow-hash.c +++ b/src/crypto/slow-hash.c @@ -939,7 +939,6 @@ void cn_slow_hash(const void *data, size_t length, char *hash) // ND: Some minor optimizations for ARMv7 (raspberrry pi 2), effect seems to be ~40-50% faster. // Needs more work. -#include "aesb.c" #ifdef NO_OPTIMIZED_MULTIPLY_ON_ARM /* The asm corresponds to this C code */ -- cgit v1.2.3 From e1c7af35d47c6f54628418f67128074c1bcd4858 Mon Sep 17 00:00:00 2001 From: redfish Date: Sat, 17 Sep 2016 13:59:29 -0400 Subject: 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. --- src/CMakeLists.txt | 2 +- src/blockchain_db/CMakeLists.txt | 10 ++-------- src/blockchain_utilities/CMakeLists.txt | 24 ++++++++++++++++-------- src/common/CMakeLists.txt | 4 +++- src/crypto/CMakeLists.txt | 5 +++++ src/cryptonote_core/CMakeLists.txt | 6 +++--- src/cryptonote_protocol/CMakeLists.txt | 14 ++++---------- src/daemon/CMakeLists.txt | 4 +--- src/daemonizer/CMakeLists.txt | 8 ++------ src/mnemonics/CMakeLists.txt | 4 ++-- src/p2p/CMakeLists.txt | 17 ++++++++++------- src/ringct/CMakeLists.txt | 10 ++-------- src/rpc/CMakeLists.txt | 6 ++---- src/simplewallet/CMakeLists.txt | 8 +++++--- src/wallet/CMakeLists.txt | 8 +++++--- 15 files changed, 63 insertions(+), 67 deletions(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 55a276f06..a2e650928 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -66,7 +66,7 @@ function (bitmonero_add_executable name) add_executable("${name}" ${ARGN}) target_link_libraries("${name}" - LINK_PRIVATE + PRIVATE ${EXTRA_LIBRARIES}) set_property(TARGET "${name}" PROPERTY diff --git a/src/blockchain_db/CMakeLists.txt b/src/blockchain_db/CMakeLists.txt index 39459d5c4..7bca66b8b 100644 --- a/src/blockchain_db/CMakeLists.txt +++ b/src/blockchain_db/CMakeLists.txt @@ -60,18 +60,12 @@ bitmonero_add_library(blockchain_db ${blockchain_db_headers} ${blockchain_db_private_headers}) target_link_libraries(blockchain_db - LINK_PUBLIC + PUBLIC common crypto - cryptonote_core - ${Boost_DATE_TIME_LIBRARY} - ${Boost_CHRONO_LIBRARY} - ${Boost_PROGRAM_OPTIONS_LIBRARY} - ${Boost_SERIALIZATION_LIBRARY} ${LMDB_LIBRARY} ${BDB_LIBRARY} - LINK_PRIVATE ${Boost_FILESYSTEM_LIBRARY} - ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} + PRIVATE ${EXTRA_LIBRARIES}) diff --git a/src/blockchain_utilities/CMakeLists.txt b/src/blockchain_utilities/CMakeLists.txt index 6f62128cc..13093f6ad 100644 --- a/src/blockchain_utilities/CMakeLists.txt +++ b/src/blockchain_utilities/CMakeLists.txt @@ -63,11 +63,15 @@ bitmonero_add_executable(blockchain_import ${blockchain_import_private_headers}) target_link_libraries(blockchain_import - LINK_PRIVATE + PRIVATE cryptonote_core - blockchain_db - p2p - ${CMAKE_THREAD_LIBS_INIT}) + blockchain_db + p2p + ${Boost_FILESYSTEM_LIBRARY} + ${Boost_SYSTEM_LIBRARY} + ${Boost_THREAD_LIBRARY} + ${CMAKE_THREAD_LIBS_INIT} + ${EXTRA_LIBRARIES}) if(ARCH_WIDTH) target_compile_definitions(blockchain_import @@ -85,11 +89,15 @@ bitmonero_add_executable(blockchain_export ${blockchain_export_private_headers}) target_link_libraries(blockchain_export - LINK_PRIVATE + PRIVATE cryptonote_core - p2p - blockchain_db - ${CMAKE_THREAD_LIBS_INIT}) + blockchain_db + p2p + ${Boost_FILESYSTEM_LIBRARY} + ${Boost_SYSTEM_LIBRARY} + ${Boost_THREAD_LIBRARY} + ${CMAKE_THREAD_LIBS_INIT} + ${EXTRA_LIBRARIES}) add_dependencies(blockchain_export version) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 7a2457c93..744559072 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -62,13 +62,15 @@ bitmonero_add_library(common ${common_headers} ${common_private_headers}) target_link_libraries(common - LINK_PRIVATE + PUBLIC crypto ${UNBOUND_LIBRARY} ${LIBUNWIND_LIBRARIES} ${Boost_DATE_TIME_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} + ${Boost_THREAD_LIBRARY} + PRIVATE ${EXTRA_LIBRARIES}) #bitmonero_install_headers(common diff --git a/src/crypto/CMakeLists.txt b/src/crypto/CMakeLists.txt index ed668022f..28f845d47 100644 --- a/src/crypto/CMakeLists.txt +++ b/src/crypto/CMakeLists.txt @@ -74,6 +74,11 @@ bitmonero_add_library(crypto ${crypto_sources} ${crypto_headers} ${crypto_private_headers}) +target_link_libraries(crypto + PUBLIC + ${Boost_SYSTEM_LIBRARY} + PRIVATE + ${EXTRA_LIBRARIES}) if (ARM) option(NO_OPTIMIZED_MULTIPLY_ON_ARM diff --git a/src/cryptonote_core/CMakeLists.txt b/src/cryptonote_core/CMakeLists.txt index 4ebfd01e3..89bf2f682 100644 --- a/src/cryptonote_core/CMakeLists.txt +++ b/src/cryptonote_core/CMakeLists.txt @@ -73,7 +73,7 @@ bitmonero_add_library(cryptonote_core ${cryptonote_core_headers} ${cryptonote_core_private_headers}) target_link_libraries(cryptonote_core - LINK_PUBLIC + PUBLIC common crypto otshell_utils @@ -82,9 +82,9 @@ target_link_libraries(cryptonote_core ${Boost_DATE_TIME_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_SERIALIZATION_LIBRARY} - LINK_PRIVATE - ${Blocks} ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} + PRIVATE + ${Blocks} ${EXTRA_LIBRARIES}) diff --git a/src/cryptonote_protocol/CMakeLists.txt b/src/cryptonote_protocol/CMakeLists.txt index 0d759e9c4..21925b60e 100644 --- a/src/cryptonote_protocol/CMakeLists.txt +++ b/src/cryptonote_protocol/CMakeLists.txt @@ -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) diff --git a/src/daemon/CMakeLists.txt b/src/daemon/CMakeLists.txt index a8c93aa0f..8f9a50f13 100644 --- a/src/daemon/CMakeLists.txt +++ b/src/daemon/CMakeLists.txt @@ -83,7 +83,7 @@ bitmonero_add_executable(daemon ${blocksdat} ) target_link_libraries(daemon - LINK_PRIVATE + PRIVATE rpc blockchain_db cryptonote_core @@ -98,9 +98,7 @@ target_link_libraries(daemon ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_REGEX_LIBRARY} ${Boost_SYSTEM_LIBRARY} - ${Boost_THREAD_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} - ${UPNP_LIBRARIES} ${EXTRA_LIBRARIES}) add_dependencies(daemon version) set_property(TARGET daemon diff --git a/src/daemonizer/CMakeLists.txt b/src/daemonizer/CMakeLists.txt index 3ca6841e5..eee2c5091 100644 --- a/src/daemonizer/CMakeLists.txt +++ b/src/daemonizer/CMakeLists.txt @@ -61,14 +61,10 @@ bitmonero_add_library(daemonizer ${daemonizer_headers} ${daemonizer_private_headers}) target_link_libraries(daemonizer - LINK_PRIVATE + PUBLIC common ${Boost_CHRONO_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} - ${Boost_REGEX_LIBRARY} - ${Boost_SYSTEM_LIBRARY} - ${Boost_THREAD_LIBRARY} - ${CMAKE_THREAD_LIBS_INIT} - ${UPNP_LIBRARIES} + PRIVATE ${EXTRA_LIBRARIES}) diff --git a/src/mnemonics/CMakeLists.txt b/src/mnemonics/CMakeLists.txt index 1d43a02e7..34670f32d 100644 --- a/src/mnemonics/CMakeLists.txt +++ b/src/mnemonics/CMakeLists.txt @@ -51,5 +51,5 @@ bitmonero_add_library(mnemonics ${mnemonics_headers} ${mnemonics_private_headers}) target_link_libraries(mnemonics - LINK_PRIVATE - ${Boost_SYSTEM_LIBRARY}) + PRIVATE + ${EXTRA_LIBRARIES}) diff --git a/src/p2p/CMakeLists.txt b/src/p2p/CMakeLists.txt index 73b39c45d..f59bc3189 100644 --- a/src/p2p/CMakeLists.txt +++ b/src/p2p/CMakeLists.txt @@ -36,12 +36,15 @@ source_group(p2p FILES ${P2P}) #bitmonero_private_headers(p2p ${P2P}) bitmonero_add_library(p2p ${P2P}) -#target_link_libraries(p2p) -# LINK_PRIVATE -# ${Boost_CHRONO_LIBRARY} -# ${Boost_REGEX_LIBRARY} -# ${Boost_SYSTEM_LIBRARY} -# ${Boost_THREAD_LIBRARY} -# ${EXTRA_LIBRARIES}) +target_link_libraries(p2p + PUBLIC + ${UPNP_LIBRARIES} + ${Boost_CHRONO_LIBRARY} + ${Boost_PROGRAM_OPTIONS_LIBRARY} + ${Boost_FILESYSTEM_LIBRARY} + ${Boost_SYSTEM_LIBRARY} + ${Boost_THREAD_LIBRARY} + PRIVATE + ${EXTRA_LIBRARIES}) add_dependencies(p2p version) diff --git a/src/ringct/CMakeLists.txt b/src/ringct/CMakeLists.txt index 078199bb0..e513c5a09 100644 --- a/src/ringct/CMakeLists.txt +++ b/src/ringct/CMakeLists.txt @@ -46,14 +46,8 @@ bitmonero_add_library(ringct ${ringct_headers} ${ringct_private_headers}) target_link_libraries(ringct - LINK_PUBLIC + PUBLIC common crypto - ${Boost_DATE_TIME_LIBRARY} - ${Boost_PROGRAM_OPTIONS_LIBRARY} - ${Boost_SERIALIZATION_LIBRARY} - LINK_PRIVATE - ${Boost_FILESYSTEM_LIBRARY} - ${Boost_SYSTEM_LIBRARY} - ${Boost_THREAD_LIBRARY} + PRIVATE ${EXTRA_LIBRARIES}) diff --git a/src/rpc/CMakeLists.txt b/src/rpc/CMakeLists.txt index 6e90d1a91..1716da75b 100644 --- a/src/rpc/CMakeLists.txt +++ b/src/rpc/CMakeLists.txt @@ -43,13 +43,11 @@ bitmonero_add_library(rpc ${rpc_headers} ${rpc_private_headers}) target_link_libraries(rpc - LINK_PRIVATE + PUBLIC cryptonote_core cryptonote_protocol - ${Boost_CHRONO_LIBRARY} - ${Boost_REGEX_LIBRARY} - ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} + PRIVATE ${EXTRA_LIBRARIES}) add_dependencies(rpc version) diff --git a/src/simplewallet/CMakeLists.txt b/src/simplewallet/CMakeLists.txt index 572819899..5745781ef 100644 --- a/src/simplewallet/CMakeLists.txt +++ b/src/simplewallet/CMakeLists.txt @@ -43,7 +43,7 @@ bitmonero_add_executable(simplewallet ${simplewallet_headers} ${simplewallet_private_headers}) target_link_libraries(simplewallet - LINK_PRIVATE + PRIVATE wallet rpc cryptonote_core @@ -51,8 +51,10 @@ target_link_libraries(simplewallet common mnemonics p2p - ${UNBOUND_LIBRARY} - ${UPNP_LIBRARIES} + ${Boost_CHRONO_LIBRARY} + ${Boost_PROGRAM_OPTIONS_LIBRARY} + ${Boost_FILESYSTEM_LIBRARY} + ${Boost_THREAD_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${EXTRA_LIBRARIES}) add_dependencies(simplewallet diff --git a/src/wallet/CMakeLists.txt b/src/wallet/CMakeLists.txt index 96653556b..506eaef85 100644 --- a/src/wallet/CMakeLists.txt +++ b/src/wallet/CMakeLists.txt @@ -64,17 +64,19 @@ bitmonero_add_library(wallet ${wallet_api_headers} ${wallet_private_headers}) target_link_libraries(wallet - LINK_PUBLIC + PUBLIC cryptonote_core mnemonics - LINK_PRIVATE + p2p + ${Boost_CHRONO_LIBRARY} ${Boost_SERIALIZATION_LIBRARY} + ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${Boost_REGEX_LIBRARY} + PRIVATE ${EXTRA_LIBRARIES}) - # build and install libwallet_merged only if we building for GUI if (BUILD_GUI_DEPS) set(libs_to_merge wallet cryptonote_core mnemonics common crypto ringct) -- cgit v1.2.3 From 06bb6923c3068637af729dd7e7500ce1a6c888b9 Mon Sep 17 00:00:00 2001 From: redfish Date: Sat, 17 Sep 2016 14:03:51 -0400 Subject: cmake: support BUILD_SHARED_LIBS built-in option Support building internal libraries as shared. This reduces development time by eliminating the need to re-link all binaries every time non-interface code in the library changes. Instead, can hack on libxyz, then `make libxyz`, and re-run monerod. By default BUILD_SHARED_LIBS is OFF in release build type, and ON in debug build type, but can be overriden with -D. --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a2e650928..31694cf81 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -88,7 +88,7 @@ function (bitmonero_add_library name) # libwallet, which combines multiple components. set(objlib obj_${name}) add_library(${objlib} OBJECT ${ARGN}) - add_library("${name}" STATIC $) + add_library("${name}" $) set_property(TARGET "${name}" PROPERTY FOLDER "libs") -- cgit v1.2.3