diff --git a/CMakeLists.txt b/CMakeLists.txt index e349c7a66..9cde81ab0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,7 @@ find_package(Boost REQUIRED COMPONENTS log log_setup thread filesystem exception find_package(Boost QUIET OPTIONAL_COMPONENTS system) find_package(nlohmann_json REQUIRED) +find_package(yaml-cpp REQUIRED) # hoisted to root so yaml-cpp::yaml-cpp is visible to src/c2pool OBJECT libs (sibling of src/core) # Threading (needed by LevelDB on some platforms) find_package(Threads REQUIRED) diff --git a/src/c2pool/CMakeLists.txt b/src/c2pool/CMakeLists.txt index e6ab86d83..e8fa4123b 100644 --- a/src/c2pool/CMakeLists.txt +++ b/src/c2pool/CMakeLists.txt @@ -1,48 +1,79 @@ # Enhanced C2Pool Components # Hashrate Tracker Library -add_library(c2pool_hashrate +add_library(c2pool_hashrate OBJECT hashrate/tracker.cpp ) target_include_directories(c2pool_hashrate PUBLIC .) -target_link_libraries(c2pool_hashrate +target_link_libraries(c2pool_hashrate + yaml-cpp::yaml-cpp btclibs - core nlohmann_json::nlohmann_json + # lib does not link core (SCC break); carry Boost.Log explicitly so ld64 resolves + # it on AppleClang arm64 (same carry pattern as c2pool_storage/c2pool_payout, #22/#39). + Boost::log + Boost::log_setup ) +target_include_directories(c2pool_hashrate PRIVATE ${CMAKE_SOURCE_DIR}/src) # Difficulty Adjustment Engine Library add_library(c2pool_difficulty difficulty/adjustment_engine.cpp ) target_include_directories(c2pool_difficulty PUBLIC .) -target_link_libraries(c2pool_difficulty +target_link_libraries(c2pool_difficulty + yaml-cpp::yaml-cpp btclibs - core nlohmann_json::nlohmann_json + # lib does not link core (SCC break); carry Boost.Log explicitly so ld64 resolves + # it on AppleClang arm64 (same carry pattern as c2pool_storage/c2pool_payout, #22/#39). + Boost::log + Boost::log_setup ) +# Stays STATIC (one-way into core, outside the SCC); drop the core link edge so its +# archive does not absorb core OBJECT files (would duplicate at the final link). +target_include_directories(c2pool_difficulty PRIVATE ${CMAKE_SOURCE_DIR}/src) # Storage Manager Library -add_library(c2pool_storage +add_library(c2pool_storage OBJECT storage/sharechain_storage.cpp ) target_include_directories(c2pool_storage PUBLIC .) -target_link_libraries(c2pool_storage - core +target_link_libraries(c2pool_storage + yaml-cpp::yaml-cpp btclibs + # storage/sharechain_storage.cpp pulls core/leveldb_store.hpp -> . + # This OBJECT lib deliberately does not link core (SCC break), so it must carry + # the leveldb usage requirement itself. On Conan/MSVC the include dir propagates + # only via the leveldb::leveldb imported target; without this, Windows fails + # C1083 leveldb/db.h (Linux happens to find it on the default system path). + ${LEVELDB_LIBRARIES} + # sharechain_storage.cpp uses (LOG_* -> Boost.Log trivial). OBJECT + # lib does not link core (SCC break); carry Boost.Log explicitly so ld64 resolves + # it on AppleClang arm64 (same carry pattern as c2pool_payout/c2pool_merged_mining, + # #22/#39). + Boost::log + Boost::log_setup ) +target_include_directories(c2pool_storage PRIVATE ${CMAKE_SOURCE_DIR}/src) # Merged Mining Manager Library (integrated mm-adapter) -add_library(c2pool_merged_mining +add_library(c2pool_merged_mining OBJECT merged/merged_mining.cpp ) target_include_directories(c2pool_merged_mining PUBLIC .) target_link_libraries(c2pool_merged_mining - core + yaml-cpp::yaml-cpp btclibs nlohmann_json::nlohmann_json ${Boost_LIBRARIES} + # merged_mining.cpp uses (LOG_* -> Boost.Log trivial). OBJECT lib + # does not link core (SCC break); carry Boost.Log explicitly so ld64 resolves it + # on AppleClang arm64 (same fix class as c2pool_storage/leveldb, #22/#39). + Boost::log + Boost::log_setup ) +target_include_directories(c2pool_merged_mining PRIVATE ${CMAKE_SOURCE_DIR}/src) # Enhanced Node Library (header-only template after M6 decoupling). # Coin-agnostic; callers that use the LTC alias (enhanced_node.hpp) must link @@ -80,9 +111,14 @@ target_link_libraries(c2pool c2pool_merged_mining core ltc + # OBJECT sets reachable only transitively via ltc (itself OBJECT) do not + # propagate their objects into the exe link; name them directly (#22/#39). + c2pool_storage + ltc_coin nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) +target_link_libraries(c2pool c2pool_hashrate pool) # OBJECT-lib SCC direct-naming (#22/#39) # Enhanced version with explicit name (for backward compatibility) add_executable(c2pool_enhanced c2pool_refactored.cpp) @@ -92,9 +128,12 @@ target_link_libraries(c2pool_enhanced c2pool_merged_mining core ltc + c2pool_storage + ltc_coin nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) +target_link_libraries(c2pool_enhanced c2pool_hashrate pool) # OBJECT-lib SCC direct-naming (#22/#39) # Windows: Boost.Asio requires Winsock libraries; /bigobj for large translation units if(WIN32) @@ -111,7 +150,8 @@ endif() # Test applications add_executable(test_ltc_node test_ltc_node.cpp) -target_link_libraries(test_ltc_node $) +target_link_libraries(test_ltc_node core ltc) +target_link_libraries(test_ltc_node c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage ltc_coin pool) # OBJECT-lib SCC direct-naming (#22/#39) target_link_libraries(test_ltc_node nlohmann_json::nlohmann_json) # Legacy applications have been archived to ../../archive/ @@ -122,8 +162,12 @@ target_link_libraries(test_ltc_node nlohmann_json::nlohmann_json) add_subdirectory(ltc) add_subdirectory(payout) -# core's web_server.cpp references symbols from c2pool_payout, c2pool_hashrate, -# and secp256k1, so expose them transitively so any target linking core also -# picks them up (fixes link ordering for test executables). -# NOTE: uses plain signature to match core/CMakeLists.txt's style. -target_link_libraries(core c2pool_payout c2pool_hashrate c2pool_merged_mining ltc ${SECP256K1_LIBRARIES}) \ No newline at end of file +# core/web_server.cpp references symbols from c2pool_payout, c2pool_hashrate and +# c2pool_merged_mining. With OBJECT libraries every consumer pools ALL of core's +# objects (including web_server.o), so those symbols must reach every core consumer. +# Propagate them as INTERFACE deps (consumers pool their objects) with NO back-edge +# into core: the payout/hashrate/merged OBJECT libs no longer link core (header-only +# access via the global src/ include path), keeping the target graph ACYCLIC so CMake +# accepts the non-STATIC SCC. secp256k1 (external) likewise propagated via INTERFACE. +# Source-level dissolution of these core->c2pool deps is deferred to V37. +target_link_libraries(core INTERFACE c2pool_payout c2pool_hashrate c2pool_merged_mining ${SECP256K1_LIBRARIES}) \ No newline at end of file diff --git a/src/c2pool/ltc/CMakeLists.txt b/src/c2pool/ltc/CMakeLists.txt index 248a29cec..beece939f 100644 --- a/src/c2pool/ltc/CMakeLists.txt +++ b/src/c2pool/ltc/CMakeLists.txt @@ -1,7 +1,9 @@ add_executable(ltc_pool_test ltc_pool_test.cpp) target_link_libraries(ltc_pool_test core btclibs ltc) +target_link_libraries(ltc_pool_test c2pool_payout c2pool_hashrate ltc_coin c2pool_storage c2pool_merged_mining pool) # OBJECT-lib SCC direct-naming (#22/#39) target_link_libraries(ltc_pool_test nlohmann_json::nlohmann_json) add_executable(ltc_coin_test ltc_coin_test.cpp) target_link_libraries(ltc_coin_test core btclibs pool ltc ltc_coin) +target_link_libraries(ltc_coin_test c2pool_payout c2pool_hashrate c2pool_storage c2pool_merged_mining) # OBJECT-lib SCC direct-naming (#22/#39) target_link_libraries(ltc_coin_test nlohmann_json::nlohmann_json) \ No newline at end of file diff --git a/src/c2pool/payout/CMakeLists.txt b/src/c2pool/payout/CMakeLists.txt index 64f819ec4..38d03c2c0 100644 --- a/src/c2pool/payout/CMakeLists.txt +++ b/src/c2pool/payout/CMakeLists.txt @@ -1,5 +1,5 @@ # C2Pool Payout Management Library -add_library(c2pool_payout +add_library(c2pool_payout OBJECT payout_manager.cpp ) @@ -10,10 +10,17 @@ target_include_directories(c2pool_payout PUBLIC ) target_link_libraries(c2pool_payout + yaml-cpp::yaml-cpp nlohmann_json::nlohmann_json ${Boost_LIBRARIES} + # payout_manager.cpp uses (LOG_* -> Boost.Log trivial). This OBJECT + # lib deliberately does not link core (SCC break), so it must carry the Boost.Log + # usage requirement itself via the imported targets. ${Boost_LIBRARIES} alone does + # not reliably resolve the log component through ld64 static archives on AppleClang + # arm64 (GCC/MSVC tolerated it); name Boost::log/log_setup explicitly (#22/#39). + Boost::log + Boost::log_setup btclibs - core ) # Ensure headers are available diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index f0055d425..5071dc7c2 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -43,10 +43,10 @@ find_package(yaml-cpp REQUIRED) # half landed in 07165699; this wires the leaf library into the build. add_library(core_util STATIC core_util.cpp) -add_library(core STATIC ${source}) -target_link_libraries(core core_util btclibs) +add_library(core OBJECT ${source}) +target_link_libraries(core PUBLIC core_util btclibs) -target_link_libraries(core Boost::headers Boost::exception Boost::log Boost::log_setup Boost::thread Boost::filesystem yaml-cpp nlohmann_json::nlohmann_json ${LEVELDB_LIBRARIES}) +target_link_libraries(core PUBLIC Boost::headers Boost::exception Boost::log Boost::log_setup Boost::thread Boost::filesystem yaml-cpp nlohmann_json::nlohmann_json ${LEVELDB_LIBRARIES}) # Add LevelDB include directories target_include_directories(core PUBLIC ${LEVELDB_INCLUDE_DIRS}) diff --git a/src/core/factory.hpp b/src/core/factory.hpp index ec783f3e3..3ba0ec051 100644 --- a/src/core/factory.hpp +++ b/src/core/factory.hpp @@ -3,6 +3,7 @@ #include #include +#include #include #include @@ -10,25 +11,9 @@ namespace io = boost::asio; namespace core { -// Bug 3 root-cause fix: INetwork inherits enable_shared_from_this so -// Factory::Client / Factory::Server can capture weak_from_this() into -// their async lambdas instead of raw `this`. When the derived node -// (e.g. dash::coin::p2p::NodeP2P) is owned by a shared_ptr, the captured -// weak_ptr keeps it alive across the async callback's execution, fixing -// the use-after-free that produced the 19:23:15 UTC SIGSEGV in -// codecvt::do_length called from the boost::log formatter inside -// NodeP2P::connected on a freed m_target_addr. -// -// For derived nodes NOT owned by shared_ptr (current LTC/DOGE pattern), -// weak_from_this() returns an empty weak_ptr; Factory falls back to the -// raw m_node pointer (preserves prior behavior — LTC/DOGE haven't been -// observed to crash, the disconnect-reconnect cascade is Dash-specific). -struct INetwork : public std::enable_shared_from_this -{ - virtual ~INetwork() = default; - virtual void connected(std::shared_ptr socket) = 0; - virtual void disconnect() = 0; -}; +// INetwork moved to core/inetwork.hpp (included above) so socket.hpp can see +// its full definition. See that header for the Bug 3 enable_shared_from_this +// rationale. class Server { diff --git a/src/core/inetwork.hpp b/src/core/inetwork.hpp new file mode 100644 index 000000000..9b36b43f2 --- /dev/null +++ b/src/core/inetwork.hpp @@ -0,0 +1,37 @@ +#pragma once + +#include + +namespace core +{ +// Forward declaration: INetwork only needs Socket as an incomplete type for the +// shared_ptr in connected(); the full Socket definition lives in socket.hpp. +class Socket; + +// Bug 3 root-cause fix: INetwork inherits enable_shared_from_this so +// Factory::Client / Factory::Server can capture weak_from_this() into +// their async lambdas instead of raw `this`. When the derived node +// (e.g. dash::coin::p2p::NodeP2P) is owned by a shared_ptr, the captured +// weak_ptr keeps it alive across the async callback's execution, fixing +// the use-after-free that produced the 19:23:15 UTC SIGSEGV in +// codecvt::do_length called from the boost::log formatter inside +// NodeP2P::connected on a freed m_target_addr. +// +// For derived nodes NOT owned by shared_ptr (current LTC/DOGE pattern), +// weak_from_this() returns an empty weak_ptr; Factory falls back to the +// raw m_node pointer (preserves prior behavior — LTC/DOGE haven't been +// observed to crash, the disconnect-reconnect cascade is Dash-specific). +// +// Lives in its own header (not factory.hpp) so socket.hpp can include the full +// definition: make_socket() dynamic_casts to INetwork* and calls +// weak_from_this(), both of which require a complete type. AppleClang/MSVC +// diagnose the incomplete forward-declared type at template-parse time where +// GNU ld-era GCC tolerated it. +struct INetwork : public std::enable_shared_from_this +{ + virtual ~INetwork() = default; + virtual void connected(std::shared_ptr socket) = 0; + virtual void disconnect() = 0; +}; + +} // namespace core diff --git a/src/core/socket.hpp b/src/core/socket.hpp index 53a19ef0d..bb1ddeb33 100644 --- a/src/core/socket.hpp +++ b/src/core/socket.hpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -20,10 +21,8 @@ namespace core { -// Forward-declared to avoid circular include with factory.hpp (which includes -// socket.hpp). Socket needs INetwork only for weak_ptr liveness -// tracking; full definition is needed in socket.cpp via factory.hpp. -struct INetwork; +// INetwork is defined in core/inetwork.hpp (included above) so the make_socket +// template below sees its complete type for the dynamic_cast + weak_from_this(). enum connection_type { diff --git a/src/core/test/CMakeLists.txt b/src/core/test/CMakeLists.txt index 784c1b543..2d3bdfdce 100644 --- a/src/core/test/CMakeLists.txt +++ b/src/core/test/CMakeLists.txt @@ -1,6 +1,7 @@ if (BUILD_TESTING AND (GTest_FOUND OR GTEST_FOUND)) add_executable(core_test pack_test.cpp events_test.cpp chain_test.cpp packet_test.cpp) target_link_libraries(core_test PRIVATE GTest::gtest_main core c2pool_merged_mining GTest::gtest) + target_link_libraries(core_test PRIVATE c2pool_payout c2pool_hashrate ltc_coin) # OBJECT-lib SCC direct-naming (#22/#39) include(GoogleTest) include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR}) diff --git a/src/impl/ltc/CMakeLists.txt b/src/impl/ltc/CMakeLists.txt index a83095556..c49071d39 100644 --- a/src/impl/ltc/CMakeLists.txt +++ b/src/impl/ltc/CMakeLists.txt @@ -1,6 +1,6 @@ add_subdirectory(coin) -add_library(ltc +add_library(ltc OBJECT config_coin.hpp config_coin.cpp config_pool.hpp config_pool.cpp config.hpp node.hpp node.cpp peer.hpp diff --git a/src/impl/ltc/coin/CMakeLists.txt b/src/impl/ltc/coin/CMakeLists.txt index 75c9e5771..27a92440a 100644 --- a/src/impl/ltc/coin/CMakeLists.txt +++ b/src/impl/ltc/coin/CMakeLists.txt @@ -19,6 +19,6 @@ set(ltc_coin_interface ) -add_library(ltc_coin ${ltc_coin_interface} ${ltc_coin_impl}) +add_library(ltc_coin OBJECT ${ltc_coin_interface} ${ltc_coin_impl}) target_link_libraries(ltc_coin core nlohmann_json::nlohmann_json) \ No newline at end of file diff --git a/src/impl/ltc/test/CMakeLists.txt b/src/impl/ltc/test/CMakeLists.txt index 01f726a7e..84b515305 100644 --- a/src/impl/ltc/test/CMakeLists.txt +++ b/src/impl/ltc/test/CMakeLists.txt @@ -2,8 +2,9 @@ if (BUILD_TESTING AND GTest_FOUND) add_executable(share_test share_test.cpp) target_link_libraries(share_test PRIVATE GTest::gtest_main GTest::gtest - $ + core ltc ) + target_link_libraries(share_test PRIVATE c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage ltc_coin pool) # OBJECT-lib SCC direct-naming (#22/#39) include(GoogleTest) include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR}) diff --git a/src/pool/CMakeLists.txt b/src/pool/CMakeLists.txt index c03c201db..7b27abffa 100644 --- a/src/pool/CMakeLists.txt +++ b/src/pool/CMakeLists.txt @@ -4,5 +4,5 @@ set(pool_source protocol.hpp ) -add_library(pool STATIC ${pool_source}) +add_library(pool OBJECT ${pool_source}) target_link_libraries(pool core) \ No newline at end of file diff --git a/src/sharechain/CMakeLists.txt b/src/sharechain/CMakeLists.txt index f4f5a49ab..6ff4561dd 100644 --- a/src/sharechain/CMakeLists.txt +++ b/src/sharechain/CMakeLists.txt @@ -8,7 +8,7 @@ set(SHARECHAIN_SOURCE ${legacy_tracker} ) -add_library(sharechain STATIC ${SHARECHAIN_SOURCE}) +add_library(sharechain OBJECT ${SHARECHAIN_SOURCE}) target_link_libraries(sharechain core) add_subdirectory(test) \ No newline at end of file diff --git a/src/sharechain/test/CMakeLists.txt b/src/sharechain/test/CMakeLists.txt index adae8be77..2de93ee4e 100644 --- a/src/sharechain/test/CMakeLists.txt +++ b/src/sharechain/test/CMakeLists.txt @@ -2,8 +2,9 @@ if (BUILD_TESTING AND GTest_FOUND) add_executable(sharechain_test share_test.cpp) target_link_libraries(sharechain_test PRIVATE GTest::gtest_main GTest::gtest - $ + core ltc ) + target_link_libraries(sharechain_test PRIVATE c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage ltc_coin pool) # OBJECT-lib SCC direct-naming (#22/#39) include(GoogleTest) include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR}) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index a66b4ffd4..b349820c0 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -2,10 +2,11 @@ if (BUILD_TESTING AND GTest_FOUND) add_executable(test_coin_broadcaster test_coin_broadcaster.cpp) target_link_libraries(test_coin_broadcaster PRIVATE GTest::gtest_main GTest::gtest - $ + core ltc nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_coin_broadcaster PRIVATE c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage ltc_coin pool) # OBJECT-lib SCC direct-naming (#22/#39) add_executable(test_share_messages test_share_messages.cpp) target_link_libraries(test_share_messages PRIVATE @@ -14,6 +15,7 @@ if (BUILD_TESTING AND GTest_FOUND) nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_share_messages PRIVATE c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage ltc_coin pool) # OBJECT-lib SCC direct-naming (#22/#39) add_executable(test_hardening test_hardening.cpp) target_link_libraries(test_hardening PRIVATE @@ -22,6 +24,7 @@ if (BUILD_TESTING AND GTest_FOUND) nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_hardening PRIVATE c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage ltc_coin pool) # OBJECT-lib SCC direct-naming (#22/#39) add_executable(test_utxo test_utxo.cpp) target_link_libraries(test_utxo PRIVATE @@ -30,6 +33,7 @@ if (BUILD_TESTING AND GTest_FOUND) nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_utxo PRIVATE c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage ltc_coin pool) # OBJECT-lib SCC direct-naming (#22/#39) gtest_discover_tests(test_utxo) add_executable(test_redistribute_address test_redistribute_address.cpp) @@ -40,14 +44,16 @@ if (BUILD_TESTING AND GTest_FOUND) nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_redistribute_address PRIVATE ltc_coin c2pool_storage pool) # OBJECT-lib SCC direct-naming (#22/#39) add_executable(test_phase0_live test_phase0_live.cpp) target_link_libraries(test_phase0_live PRIVATE GTest::gtest_main GTest::gtest - $ + core ltc nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_phase0_live PRIVATE c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage ltc_coin pool) # OBJECT-lib SCC direct-naming (#22/#39) add_executable(test_header_chain test_header_chain.cpp) target_link_libraries(test_header_chain PRIVATE @@ -56,14 +62,16 @@ if (BUILD_TESTING AND GTest_FOUND) nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_header_chain PRIVATE c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage ltc_coin pool) # OBJECT-lib SCC direct-naming (#22/#39) add_executable(test_phase1_live test_phase1_live.cpp) target_link_libraries(test_phase1_live PRIVATE GTest::gtest_main GTest::gtest - $ + core ltc nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_phase1_live PRIVATE c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage ltc_coin pool) # OBJECT-lib SCC direct-naming (#22/#39) add_executable(test_mempool test_mempool.cpp) target_link_libraries(test_mempool PRIVATE @@ -72,14 +80,16 @@ if (BUILD_TESTING AND GTest_FOUND) nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_mempool PRIVATE c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage ltc_coin pool) # OBJECT-lib SCC direct-naming (#22/#39) add_executable(test_phase2_live test_phase2_live.cpp) target_link_libraries(test_phase2_live PRIVATE GTest::gtest_main GTest::gtest - $ + core ltc nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_phase2_live PRIVATE c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage ltc_coin pool) # OBJECT-lib SCC direct-naming (#22/#39) add_executable(test_template_builder test_template_builder.cpp) target_link_libraries(test_template_builder PRIVATE @@ -88,14 +98,16 @@ if (BUILD_TESTING AND GTest_FOUND) nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_template_builder PRIVATE c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage ltc_coin pool) # OBJECT-lib SCC direct-naming (#22/#39) add_executable(test_phase3_live test_phase3_live.cpp) target_link_libraries(test_phase3_live PRIVATE GTest::gtest_main GTest::gtest - $ + core ltc nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_phase3_live PRIVATE c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage ltc_coin pool) # OBJECT-lib SCC direct-naming (#22/#39) add_executable(test_phase4_embedded test_phase4_embedded.cpp) target_link_libraries(test_phase4_embedded PRIVATE @@ -104,6 +116,7 @@ if (BUILD_TESTING AND GTest_FOUND) nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_phase4_embedded PRIVATE c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage ltc_coin pool) # OBJECT-lib SCC direct-naming (#22/#39) add_executable(test_phase4_live test_phase4_live.cpp) target_link_libraries(test_phase4_live PRIVATE @@ -113,6 +126,7 @@ if (BUILD_TESTING AND GTest_FOUND) nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_phase4_live PRIVATE c2pool_payout c2pool_hashrate ltc_coin c2pool_storage pool) # OBJECT-lib SCC direct-naming (#22/#39) add_executable(test_threading test_threading.cpp) target_link_libraries(test_threading PRIVATE @@ -121,6 +135,7 @@ if (BUILD_TESTING AND GTest_FOUND) nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_threading PRIVATE c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage ltc_coin pool) # OBJECT-lib SCC direct-naming (#22/#39) add_executable(test_weights test_weights.cpp) target_link_libraries(test_weights PRIVATE @@ -129,6 +144,7 @@ if (BUILD_TESTING AND GTest_FOUND) nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_weights PRIVATE c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage ltc_coin pool) # OBJECT-lib SCC direct-naming (#22/#39) include(GoogleTest) gtest_add_tests(test_weights "" AUTO) @@ -154,6 +170,7 @@ if (BUILD_TESTING AND GTest_FOUND) nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_doge_chain PRIVATE c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage ltc_coin pool) # OBJECT-lib SCC direct-naming (#22/#39) gtest_add_tests(test_doge_chain "" AUTO) add_executable(test_compact_blocks test_compact_blocks.cpp) @@ -163,6 +180,7 @@ if (BUILD_TESTING AND GTest_FOUND) nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_compact_blocks PRIVATE c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage ltc_coin pool) # OBJECT-lib SCC direct-naming (#22/#39) gtest_add_tests(test_compact_blocks "" AUTO) add_executable(test_redistribute test_redistribute.cpp) @@ -172,6 +190,7 @@ if (BUILD_TESTING AND GTest_FOUND) nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_redistribute PRIVATE c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage ltc_coin pool) # OBJECT-lib SCC direct-naming (#22/#39) gtest_add_tests(test_redistribute "" AUTO) add_executable(test_auto_ratchet test_auto_ratchet.cpp) @@ -181,6 +200,7 @@ if (BUILD_TESTING AND GTest_FOUND) nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_auto_ratchet PRIVATE c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage ltc_coin pool) # OBJECT-lib SCC direct-naming (#22/#39) gtest_add_tests(test_auto_ratchet "" AUTO) add_executable(test_stratum_extensions test_stratum_extensions.cpp) @@ -191,6 +211,7 @@ if (BUILD_TESTING AND GTest_FOUND) nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_stratum_extensions PRIVATE c2pool_payout ltc_coin c2pool_storage c2pool_merged_mining pool) # OBJECT-lib SCC direct-naming (#22/#39) gtest_add_tests(test_stratum_extensions "" AUTO) add_executable(test_multiaddress_pplns test_multiaddress_pplns.cpp) @@ -201,6 +222,7 @@ if (BUILD_TESTING AND GTest_FOUND) nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_multiaddress_pplns PRIVATE c2pool_payout c2pool_hashrate ltc_coin c2pool_storage pool) # OBJECT-lib SCC direct-naming (#22/#39) gtest_add_tests(test_multiaddress_pplns "" AUTO) add_executable(test_pplns_stress test_pplns_stress.cpp) @@ -211,6 +233,7 @@ if (BUILD_TESTING AND GTest_FOUND) nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_pplns_stress PRIVATE c2pool_payout c2pool_hashrate ltc_coin c2pool_storage pool) # OBJECT-lib SCC direct-naming (#22/#39) gtest_add_tests(test_pplns_stress "" AUTO) add_executable(test_hash_link test_hash_link.cpp) @@ -220,6 +243,7 @@ if (BUILD_TESTING AND GTest_FOUND) nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_hash_link PRIVATE c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage ltc_coin pool) # OBJECT-lib SCC direct-naming (#22/#39) gtest_add_tests(test_hash_link "" AUTO) add_executable(test_decay_pplns test_decay_pplns.cpp) @@ -229,6 +253,7 @@ if (BUILD_TESTING AND GTest_FOUND) nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_decay_pplns PRIVATE c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage ltc_coin pool) # OBJECT-lib SCC direct-naming (#22/#39) gtest_add_tests(test_decay_pplns "" AUTO) add_executable(test_pplns_consensus test_pplns_consensus.cpp) @@ -238,6 +263,7 @@ if (BUILD_TESTING AND GTest_FOUND) nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_pplns_consensus PRIVATE c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage ltc_coin pool) # OBJECT-lib SCC direct-naming (#22/#39) gtest_add_tests(test_pplns_consensus "" AUTO) add_executable(test_v36_script_sorting test_v36_script_sorting.cpp) @@ -251,6 +277,7 @@ if (BUILD_TESTING AND GTest_FOUND) GTest::gtest_main GTest::gtest core ) + target_link_libraries(test_v36_cross_impl_refhash PRIVATE c2pool_payout c2pool_hashrate ltc_coin c2pool_merged_mining) # OBJECT-lib SCC direct-naming (#22/#39) gtest_add_tests(test_v36_cross_impl_refhash "" AUTO) add_executable(test_mweb_builder test_mweb_builder.cpp) @@ -260,6 +287,7 @@ if (BUILD_TESTING AND GTest_FOUND) nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_mweb_builder PRIVATE c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage ltc_coin pool) # OBJECT-lib SCC direct-naming (#22/#39) gtest_add_tests(test_mweb_builder "" AUTO) add_executable(test_address_resolution test_address_resolution.cpp) @@ -269,6 +297,7 @@ if (BUILD_TESTING AND GTest_FOUND) nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_address_resolution PRIVATE c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage ltc_coin pool) # OBJECT-lib SCC direct-naming (#22/#39) gtest_add_tests(test_address_resolution "" AUTO) add_executable(test_compute_share_target test_compute_share_target.cpp) @@ -278,5 +307,6 @@ if (BUILD_TESTING AND GTest_FOUND) nlohmann_json::nlohmann_json ${Boost_LIBRARIES} ) + target_link_libraries(test_compute_share_target PRIVATE c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage ltc_coin pool) # OBJECT-lib SCC direct-naming (#22/#39) gtest_add_tests(test_compute_share_target "" AUTO) endif()