From d668c881c864c17b789cd7a8a037ee6c940090cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Wed, 27 Sep 2023 00:46:15 +0200 Subject: [PATCH 1/2] Fix linker warnings about duplicate libs --- nano/core_test/CMakeLists.txt | 10 +--------- nano/ipc_flatbuffers_test/CMakeLists.txt | 10 +--------- nano/lib/CMakeLists.txt | 6 +++--- nano/load_test/CMakeLists.txt | 2 +- nano/nano_node/CMakeLists.txt | 10 ++-------- nano/nano_rpc/CMakeLists.txt | 12 +----------- nano/node/CMakeLists.txt | 4 ++-- nano/rpc/CMakeLists.txt | 2 +- nano/rpc_test/CMakeLists.txt | 2 +- nano/secure/CMakeLists.txt | 10 ++-------- nano/slow_test/CMakeLists.txt | 3 +-- 11 files changed, 16 insertions(+), 55 deletions(-) diff --git a/nano/core_test/CMakeLists.txt b/nano/core_test/CMakeLists.txt index dec4062fb1..277108d068 100644 --- a/nano/core_test/CMakeLists.txt +++ b/nano/core_test/CMakeLists.txt @@ -63,15 +63,7 @@ target_compile_definitions( core_test PRIVATE -DTAG_VERSION_STRING=${TAG_VERSION_STRING} -DGIT_COMMIT_HASH=${GIT_COMMIT_HASH}) -target_link_libraries( - core_test - node - secure - test_common - gtest - libminiupnpc-static - Boost::log_setup - Boost::log) +target_link_libraries(core_test test_common) include_directories(${CMAKE_SOURCE_DIR}/submodules) include_directories(${CMAKE_SOURCE_DIR}/submodules/cpptoml/include) diff --git a/nano/ipc_flatbuffers_test/CMakeLists.txt b/nano/ipc_flatbuffers_test/CMakeLists.txt index 90ced6aaa5..7112741787 100644 --- a/nano/ipc_flatbuffers_test/CMakeLists.txt +++ b/nano/ipc_flatbuffers_test/CMakeLists.txt @@ -1,11 +1,3 @@ add_executable(ipc_flatbuffers_test_client entry.cpp) -target_link_libraries( - ipc_flatbuffers_test_client - nano_lib - Boost::filesystem - Boost::log_setup - Boost::log - Boost::program_options - Boost::system - Boost::thread) +target_link_libraries(ipc_flatbuffers_test_client node) diff --git a/nano/lib/CMakeLists.txt b/nano/lib/CMakeLists.txt index d0207325cb..6c6a22599c 100644 --- a/nano/lib/CMakeLists.txt +++ b/nano/lib/CMakeLists.txt @@ -102,13 +102,13 @@ include_directories( target_link_libraries( nano_lib - ed25519 + ipc_flatbuffers_lib crypto_lib + ed25519 blake2 - secure - ipc_flatbuffers_lib ${CRYPTOPP_LIBRARY} ${CMAKE_DL_LIBS} + Boost::iostreams Boost::asio Boost::circular_buffer Boost::dll diff --git a/nano/load_test/CMakeLists.txt b/nano/load_test/CMakeLists.txt index 9a09713c6d..71a99cc371 100644 --- a/nano/load_test/CMakeLists.txt +++ b/nano/load_test/CMakeLists.txt @@ -1,6 +1,6 @@ add_executable(load_test entry.cpp) -target_link_libraries(load_test boost_process node secure test_common gtest) +target_link_libraries(load_test test_common Boost::process) include_directories(${CMAKE_SOURCE_DIR}/submodules) include_directories(${CMAKE_SOURCE_DIR}/submodules/cpptoml/include) diff --git a/nano/nano_node/CMakeLists.txt b/nano/nano_node/CMakeLists.txt index 6ef847f808..5da26671ee 100644 --- a/nano/nano_node/CMakeLists.txt +++ b/nano/nano_node/CMakeLists.txt @@ -1,13 +1,7 @@ add_executable(nano_node daemon.cpp daemon.hpp entry.cpp) -target_link_libraries( - nano_node - Boost::process - node - rpc - secure - argon2 - ${PLATFORM_LIBS}) +target_link_libraries(nano_node node Boost::process ${PLATFORM_LIBS}) + include_directories(${CMAKE_SOURCE_DIR}/submodules) target_compile_definitions( diff --git a/nano/nano_rpc/CMakeLists.txt b/nano/nano_rpc/CMakeLists.txt index b9a07b0cf4..8390631899 100644 --- a/nano/nano_rpc/CMakeLists.txt +++ b/nano/nano_rpc/CMakeLists.txt @@ -1,16 +1,6 @@ add_executable(nano_rpc entry.cpp) -target_link_libraries( - nano_rpc - rpc - node - secure - Boost::filesystem - Boost::log_setup - Boost::log - Boost::program_options - Boost::system - Boost::thread) +target_link_libraries(nano_rpc node) target_compile_definitions( nano_rpc diff --git a/nano/node/CMakeLists.txt b/nano/node/CMakeLists.txt index 01afab48f9..3ee984b2fb 100644 --- a/nano/node/CMakeLists.txt +++ b/nano/node/CMakeLists.txt @@ -206,10 +206,10 @@ endif() target_link_libraries( node + nano_lib nano_store - rpc secure - nano_lib + rpc libminiupnpc-static argon2 lmdb diff --git a/nano/rpc/CMakeLists.txt b/nano/rpc/CMakeLists.txt index 8883819b87..c3e8cafc04 100644 --- a/nano/rpc/CMakeLists.txt +++ b/nano/rpc/CMakeLists.txt @@ -15,4 +15,4 @@ add_library( rpc_request_processor.hpp rpc_request_processor.cpp) -target_link_libraries(rpc Boost::beast nano_lib ${OPENSSL_LIBRARIES}) +target_link_libraries(rpc nano_lib Boost::beast ${OPENSSL_LIBRARIES}) diff --git a/nano/rpc_test/CMakeLists.txt b/nano/rpc_test/CMakeLists.txt index df4525a618..19256a4b6f 100644 --- a/nano/rpc_test/CMakeLists.txt +++ b/nano/rpc_test/CMakeLists.txt @@ -1,6 +1,6 @@ add_executable(rpc_test common.hpp common.cpp entry.cpp receivable.cpp rpc.cpp) -target_link_libraries(rpc_test node secure rpc test_common gtest) +target_link_libraries(rpc_test test_common) target_compile_definitions( rpc_test diff --git a/nano/secure/CMakeLists.txt b/nano/secure/CMakeLists.txt index b3691dea8e..a015189838 100644 --- a/nano/secure/CMakeLists.txt +++ b/nano/secure/CMakeLists.txt @@ -50,14 +50,8 @@ add_library( utility.cpp working.hpp) -target_link_libraries( - secure - nano_lib - ed25519 - crypto_lib - Boost::iostreams - Boost::system - Boost::filesystem) +target_link_libraries(secure nano_lib ed25519 crypto_lib Boost::system + Boost::filesystem) target_compile_definitions(secure PUBLIC -DQT_NO_KEYWORDS -DBOOST_ASIO_HAS_STD_ARRAY=1) diff --git a/nano/slow_test/CMakeLists.txt b/nano/slow_test/CMakeLists.txt index c5bbedda3a..1483d9a5ab 100644 --- a/nano/slow_test/CMakeLists.txt +++ b/nano/slow_test/CMakeLists.txt @@ -1,7 +1,6 @@ add_executable(slow_test entry.cpp node.cpp vote_cache.cpp vote_processor.cpp bootstrap.cpp) -target_link_libraries(slow_test secure node test_common gtest - libminiupnpc-static) +target_link_libraries(slow_test test_common) include_directories(${CMAKE_SOURCE_DIR}/submodules) From a0c1bd0f147620ec92855dd5aff1d41c9eb2efa4 Mon Sep 17 00:00:00 2001 From: Colin LeMahieu Date: Wed, 27 Sep 2023 15:25:14 +0100 Subject: [PATCH 2/2] Fix link order between ed25519 and needed symbols in interface.cpp --- nano/crypto_lib/CMakeLists.txt | 11 +++++++---- nano/lib/CMakeLists.txt | 1 - 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/nano/crypto_lib/CMakeLists.txt b/nano/crypto_lib/CMakeLists.txt index 99910faac3..533412cdff 100644 --- a/nano/crypto_lib/CMakeLists.txt +++ b/nano/crypto_lib/CMakeLists.txt @@ -1,5 +1,8 @@ -add_library( - crypto_lib interface.cpp random_pool.hpp random_pool.cpp - random_pool_shuffle.hpp secure_memory.hpp secure_memory.cpp) +add_library(nano_ed25519 interface.cpp) -target_link_libraries(crypto_lib blake2 ${CRYPTOPP_LIBRARY}) +target_link_libraries(ed25519 nano_ed25519) + +add_library(crypto_lib random_pool.hpp random_pool.cpp random_pool_shuffle.hpp + secure_memory.hpp secure_memory.cpp) + +target_link_libraries(crypto_lib blake2 ed25519 ${CRYPTOPP_LIBRARY}) diff --git a/nano/lib/CMakeLists.txt b/nano/lib/CMakeLists.txt index 6c6a22599c..7abb6e6558 100644 --- a/nano/lib/CMakeLists.txt +++ b/nano/lib/CMakeLists.txt @@ -104,7 +104,6 @@ target_link_libraries( nano_lib ipc_flatbuffers_lib crypto_lib - ed25519 blake2 ${CRYPTOPP_LIBRARY} ${CMAKE_DL_LIBS}