@@ -40,6 +40,7 @@ option(BUILD_DAEMON "Build bitcoind executable." ON)
4040option (BUILD_CLI "Build bitcoin-cli executable." ON )
4141option (BUILD_TX "Build bitcoin-tx executable." ON )
4242option (BUILD_UTIL "Build bitcoin-util executable." ON )
43+ option (BUILD_BITCOINCONSENSUS_LIB "Build bitcoinconsensus library." ON )
4344option (ASM "Use assembly routines." ON )
4445
4546option (ENABLE_WALLET "Enable wallet." ON )
@@ -95,9 +96,17 @@ unset(check_pie_output)
9596# It is intended to be a usage requirement for all other targets.
9697add_library (core INTERFACE )
9798
99+ # The lib interface library aims to encapsulate build flags, which
100+ # are specific to non-internal libraries.
101+ # It is intended to be a usage requirement for non-internal library
102+ # targets.
103+ add_library (lib INTERFACE )
104+
98105include (TryAppendCXXFlags)
99106include (TryAppendLinkerFlag)
100107
108+ try_append_linker_flag("-Wl,--no-undefined" TARGET lib)
109+
101110if (WIN32 )
102111 #[=[
103112 This build system supports two ways to build binaries for Windows.
@@ -306,6 +315,10 @@ if(WERROR)
306315 unset (werror_flag)
307316endif ()
308317
318+ if (BUILD_BITCOINCONSENSUS_LIB)
319+ set (HAVE_CONSENSUS_LIB TRUE )
320+ endif ()
321+
309322find_package (Python3 3.9 COMPONENTS Interpreter)
310323set (PYTHON_COMMAND ${Python3_EXECUTABLE} )
311324
@@ -326,6 +339,13 @@ message(" bitcoin-cli ......................... ${BUILD_CLI}")
326339message (" bitcoin-tx .......................... ${BUILD_TX} " )
327340message (" bitcoin-util ........................ ${BUILD_UTIL} " )
328341message (" bitcoin-wallet ...................... ${BUILD_WALLET_TOOL} " )
342+ message ("Libraries:" )
343+ if (BUILD_SHARED_LIBS )
344+ message (" library type ........................ Shared" )
345+ else ()
346+ message (" library type ........................ Static" )
347+ endif ()
348+ message (" libbitcoinconsensus ................. ${BUILD_BITCOINCONSENSUS_LIB} " )
329349message ("Wallet support:" )
330350message (" SQLite, descriptor wallets .......... ${WITH_SQLITE} " )
331351message (" Berkeley DB, legacy wallets ......... ${WITH_BDB} " )
0 commit comments