Skip to content

Commit

Permalink
Fix linker warnings about duplicate libs (#4299)
Browse files Browse the repository at this point in the history
Fix linker warnings about duplicate libs
  • Loading branch information
pwojcikdev authored Sep 27, 2023
1 parent 6a01fc4 commit a1cc7a5
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 59 deletions.
10 changes: 1 addition & 9 deletions nano/core_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 7 additions & 4 deletions nano/crypto_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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})
10 changes: 1 addition & 9 deletions nano/ipc_flatbuffers_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
5 changes: 2 additions & 3 deletions nano/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,12 @@ include_directories(

target_link_libraries(
nano_lib
ed25519
ipc_flatbuffers_lib
crypto_lib
blake2
secure
ipc_flatbuffers_lib
${CRYPTOPP_LIBRARY}
${CMAKE_DL_LIBS}
Boost::iostreams
Boost::asio
Boost::circular_buffer
Boost::dll
Expand Down
2 changes: 1 addition & 1 deletion nano/load_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
10 changes: 2 additions & 8 deletions nano/nano_node/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
12 changes: 1 addition & 11 deletions nano/nano_rpc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions nano/node/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,10 @@ endif()

target_link_libraries(
node
nano_lib
nano_store
rpc
secure
nano_lib
rpc
libminiupnpc-static
argon2
lmdb
Expand Down
2 changes: 1 addition & 1 deletion nano/rpc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
2 changes: 1 addition & 1 deletion nano/rpc_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 2 additions & 8 deletions nano/secure/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions nano/slow_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit a1cc7a5

Please sign in to comment.