Not sure if it makes sense to guard it by ENABLE_TESTS. If I just want to build the benchmarks with ./configure --disable-tests
, then my build fails:
0$ make -j 9
1Making all in src
2make[1]: Entering directory '/home/marco/workspace/btc_bitcoin_core/src'
3make[2]: Entering directory '/home/marco/workspace/btc_bitcoin_core/src'
4make[3]: Entering directory '/home/marco/workspace/btc_bitcoin_core'
5make[3]: Leaving directory '/home/marco/workspace/btc_bitcoin_core'
6 CXXLD bench/bench_bitcoin
7/usr/bin/ld: bench/bench_bitcoin-bench.o: in function `benchmark::BenchRunner::RunAll(benchmark::Printer&, unsigned long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)':
8/home/marco/workspace/btc_bitcoin_core/src/./test/util/setup_common.h:92: undefined reference to `TestingSetup::~TestingSetup()'
9/usr/bin/ld: /home/marco/workspace/btc_bitcoin_core/src/./test/util/setup_common.h:94: undefined reference to `TestingSetup::TestingSetup(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
10/usr/bin/ld: bench/bench_bitcoin-bench.o: in function `benchmark::BenchRunner::RunAll(benchmark::Printer&, unsigned long, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) [clone .cold]':
11/home/marco/workspace/btc_bitcoin_core/src/./test/util/setup_common.h:92: undefined reference to `TestingSetup::~TestingSetup()'
12/usr/bin/ld: bench/bench_bitcoin-verify_script.o: in function `VerifyScriptBench(benchmark::State&)':
13/home/marco/workspace/btc_bitcoin_core/src/bench/verify_script.cpp:40: undefined reference to `BuildCreditingTransaction(CScript const&, int)'
14/usr/bin/ld: /home/marco/workspace/btc_bitcoin_core/src/bench/verify_script.cpp:41: undefined reference to `BuildSpendingTransaction(CScript const&, CScriptWitness const&, CTransaction const&)'
15/usr/bin/ld: libbitcoin_server.a(libbitcoin_server_a-timedata.o): in function `_(char const*)':
16/home/marco/workspace/btc_bitcoin_core/src/./util/translation.h:38: undefined reference to `G_TRANSLATION_FUN[abi:cxx11]'
17/usr/bin/ld: libbitcoin_server.a(libbitcoin_server_a-timedata.o): in function `AddTimeData(CNetAddr const&, long)':
18/usr/include/c++/9/bits/std_function.h:690: undefined reference to `G_TRANSLATION_FUN[abi:cxx11]'
19/usr/bin/ld: /usr/include/c++/9/bits/std_function.h:690: undefined reference to `G_TRANSLATION_FUN[abi:cxx11]'
20/usr/bin/ld: libbitcoin_server.a(libbitcoin_server_a-txdb.o): in function `_(char const*)':
21/home/marco/workspace/btc_bitcoin_core/src/./util/translation.h:38: undefined reference to `G_TRANSLATION_FUN[abi:cxx11]'
22/usr/bin/ld: libbitcoin_server.a(libbitcoin_server_a-txdb.o): in function `CCoinsViewDB::Upgrade()':
23/usr/include/c++/9/bits/std_function.h:690: undefined reference to `G_TRANSLATION_FUN[abi:cxx11]'
24/usr/bin/ld: libbitcoin_server.a(libbitcoin_server_a-txdb.o):/usr/include/c++/9/bits/std_function.h:690: more undefined references to `G_TRANSLATION_FUN[abi:cxx11]' follow
25collect2: error: ld returned 1 exit status