Skip to content

Commit

Permalink
build: libbitcoin_sv2 scaffold
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjors committed Nov 22, 2024
1 parent f2be271 commit 965578c
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ if(WITH_MULTIPROCESS)
)
endif()

option(WITH_SV2 "Enable Stratum v2 functionality." ON)

cmake_dependent_option(BUILD_GUI_TESTS "Build test_bitcoin-qt executable." ON "BUILD_GUI;BUILD_TESTS" OFF)
if(BUILD_GUI)
set(qt_components Core Gui Widgets LinguistTools)
Expand Down Expand Up @@ -610,6 +612,7 @@ message(" ZeroMQ .............................. ${WITH_ZMQ}")
message(" USDT tracing ........................ ${WITH_USDT}")
message(" QR code (GUI) ....................... ${WITH_QRENCODE}")
message(" DBus (GUI, Linux only) .............. ${WITH_DBUS}")
message(" Stratum v2 .......................... ${WITH_SV2}")
message("Tests:")
message(" test_bitcoin ........................ ${BUILD_TESTS}")
message(" test_bitcoin-qt ..................... ${BUILD_GUI_TESTS}")
Expand Down
1 change: 1 addition & 0 deletions doc/design/libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
| *libbitcoin_wallet* | Wallet functionality used by *bitcoind* and *bitcoin-wallet* executables. |
| *libbitcoin_wallet_tool* | Lower-level wallet functionality used by *bitcoin-wallet* executable. |
| *libbitcoin_zmq* | [ZeroMQ](../zmq.md) functionality used by *bitcoind* and *bitcoin-qt* executables. |
| *libbitcoin_sv2* | Stratum v2 functionality (usage TBD) |

## Conventions

Expand Down
3 changes: 3 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ add_subdirectory(util)
if(WITH_MULTIPROCESS)
add_subdirectory(ipc)
endif()
if(WITH_SV2)
add_subdirectory(sv2)
endif()

#=============================
# secp256k1 subtree
Expand Down
14 changes: 14 additions & 0 deletions src/sv2/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (c) 2024-present The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://opensource.org/license/mit/.

add_library(bitcoin_sv2 STATIC EXCLUDE_FROM_ALL
)

target_link_libraries(bitcoin_sv2
PRIVATE
core_interface
bitcoin_clientversion
bitcoin_crypto
$<$<PLATFORM_ID:Windows>:ws2_32>
)
7 changes: 7 additions & 0 deletions src/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,13 @@ if(WITH_MULTIPROCESS)
target_link_libraries(test_bitcoin bitcoin_ipc_test bitcoin_ipc)
endif()

if(WITH_SV2)
target_sources(test_bitcoin
PRIVATE
)
target_link_libraries(test_bitcoin bitcoin_sv2)
endif()

function(add_boost_test source_file)
if(NOT EXISTS ${source_file})
return()
Expand Down
9 changes: 9 additions & 0 deletions src/test/fuzz/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,12 @@ target_link_libraries(fuzz
if(ENABLE_WALLET)
add_subdirectory(${PROJECT_SOURCE_DIR}/src/wallet/test/fuzz wallet)
endif()

if(WITH_SV2)
target_sources(fuzz
PRIVATE
)
target_link_libraries(fuzz
bitcoin_sv2
)
endif()

0 comments on commit 965578c

Please sign in to comment.