Skip to content

Commit 55dbd05

Browse files
committed
dgb(#82): define dgb/dgb_coin libs unconditionally so coin-matrix links c2pool-dgb
The run-loop slice switched c2pool-dgb to link the dgb and dgb_coin OBJECT libs, but both were defined only inside if(COIN_DGB). The coin-matrix CI job configures without -DCOIN_DGB, so the targets were undefined and CMake emitted raw -ldgb/-ldgb_coin, failing the link (cannot find -ldgb). Mirror btc/ltc, which define their per-coin libs unconditionally; keep only the test subtree behind COIN_DGB (build.yml sets the flag and builds those targets). Verified: fresh configure with COIN_DGB=OFF builds + links c2pool-dgb and --help smokes clean (EXIT=0).
1 parent 648ac2f commit 55dbd05

1 file changed

Lines changed: 25 additions & 24 deletions

File tree

src/impl/dgb/CMakeLists.txt

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# c2pool-dgb coin module (V36). Built when -DCOIN_DGB=ON.
2-
# Mirrors src/impl/btc/CMakeLists.txt; emits the c2pool-dgb binary.
1+
# c2pool-dgb coin module (V36). Mirrors src/impl/btc/CMakeLists.txt.
32
# Per-coin binary scheme: project_v36_per_coin_binary_v37_unified_process.
43
# Impl plan: c2pool-dgb-embedded-impl-plan.md (frstrtr/the docs/v36, 8ef8d2d).
54
#
@@ -11,30 +10,32 @@
1110
# in this module yet: parked behind the Phase 5.8 settle (ltc-doge owns the
1211
# shared DOGE-aux surface). Do not add AUX_DOGE plumbing here at M2.
1312
#
14-
# TODO(M3): add_library(impl_dgb ...) sources as an OBJECT lib (ci-steward
15-
# PR-CMake-object-library convention; impl_dgb = 1 of 5 per-coin OBJECT libs),
16-
# link bitcoin_family/Scrypt shared base, wire embedded DigiByte Core daemon
17-
# slice under daemon/. Top-level add_subdirectory(src/impl/dgb) registration
18-
# follows the OBJECT-lib convention PR; held ~2-3 heartbeats, not raced here.
13+
# LIB GATING (mirrors btc/ltc): the dgb_coin (coin-layer) and dgb (pool-layer)
14+
# OBJECT libs are defined UNCONDITIONALLY — the c2pool-dgb executable links
15+
# them, and the coin-matrix CI builds that exe WITHOUT -DCOIN_DGB, so the
16+
# targets MUST exist regardless of the flag (gating them behind COIN_DGB makes
17+
# the linker fall back to raw -ldgb/-ldgb_coin and fail). Only the test subtree
18+
# stays behind COIN_DGB; build.yml sets -DCOIN_DGB=ON and builds those targets.
19+
add_subdirectory(coin)
20+
# add_subdirectory(daemon)
21+
22+
# dgb -- DGB Scrypt pool-layer OBJECT lib. Mirrors the ltc/btc OBJECT lib:
23+
# compiles the real NodeImpl translation unit (node.cpp + protocol handlers)
24+
# so share_tracker.hpp / share_check.hpp are pulled into a compiled TU. Links
25+
# the shared core / pool / sharechain base plus dgb_coin (embedded P2P+mempool)
26+
# and c2pool_storage (LevelDB sharechain).
27+
add_library(dgb OBJECT
28+
config_coin.hpp config_coin.cpp config_pool.hpp config_pool.cpp
29+
node.hpp node.cpp
30+
peer.hpp
31+
protocol_actual.cpp protocol_legacy.cpp
32+
messages.hpp
33+
share_types.hpp share.hpp
34+
)
35+
target_link_libraries(dgb core pool sharechain dgb_coin btclibs c2pool_storage ${SECP256K1_LIBRARIES})
36+
1937
if(COIN_DGB)
2038
message(STATUS "c2pool: DGB Scrypt-only coin module enabled")
21-
add_subdirectory(coin)
2239
add_subdirectory(stratum) # dgb_stratum: IWorkSource (#82 miner-facing path)
23-
# add_subdirectory(daemon)
2440
add_subdirectory(test)
25-
26-
# dgb -- DGB Scrypt pool-layer OBJECT lib. Mirrors the ltc OBJECT lib
27-
# (src/impl/ltc/CMakeLists.txt): compiles the real NodeImpl translation unit
28-
# (node.cpp + protocol handlers) so share_tracker.hpp / share_check.hpp are
29-
# pulled into a compiled TU. Links the shared core / pool / sharechain base
30-
# plus dgb_coin (embedded P2P+mempool) and c2pool_storage (LevelDB sharechain).
31-
add_library(dgb OBJECT
32-
config_coin.hpp config_coin.cpp config_pool.hpp config_pool.cpp
33-
node.hpp node.cpp
34-
peer.hpp
35-
protocol_actual.cpp protocol_legacy.cpp
36-
messages.hpp
37-
share_types.hpp share.hpp
38-
)
39-
target_link_libraries(dgb core pool sharechain dgb_coin btclibs c2pool_storage ${SECP256K1_LIBRARIES})
4041
endif()

0 commit comments

Comments
 (0)