forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: Add CMake-based build system (6 of N) #15
Merged
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
b2bea9f
[FIXUP] cmake: Consider `ASM` option when checking for `HAVE_64BIT_ASM`
hebasto 5fc2cee
[FIXUP] cmake: Add workaround for https://gitlab.kitware.com/cmake/cm…
hebasto 1934755
cmake: Build `bitcoin-cli` executable
hebasto d1c319d
cmake: Build `bitcoin-tx` executable
hebasto f944ccd
cmake: Build `bitcoin-util` executable
hebasto 2e3721e
cmake: Add wallet functionality
hebasto 2fd303f
test: Make `util/test_runner.py` honor `BITCOINUTIL` and `BITCOINTX`
hebasto cb7dc94
test: Explicitly specify directory where to search tests for
hebasto a2c3493
cmake: Add test config and runners
hebasto 751453f
cmake: Build `bench_bitcoin` executable
hebasto cb19814
cmake: Build `test_bitcoin` executable
hebasto a112470
cmake: Include CTest
hebasto 2d8930e
FIXUP: Same as PR27656
hebasto 43123cf
FIXUP: Same as PR27458
hebasto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Copyright (c) 2023 The Bitcoin Core developers | ||
# Distributed under the MIT software license, see the accompanying | ||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
function(create_test_config) | ||
set(abs_top_srcdir ${PROJECT_SOURCE_DIR}) | ||
set(abs_top_builddir ${PROJECT_BINARY_DIR}) | ||
set(EXEEXT ${CMAKE_EXECUTABLE_SUFFIX}) | ||
|
||
macro(set_configure_variable var conf_var) | ||
if(${var}) | ||
set(${conf_var}_TRUE "") | ||
else() | ||
set(${conf_var}_TRUE "#") | ||
endif() | ||
endmacro() | ||
|
||
set_configure_variable(ENABLE_WALLET ENABLE_WALLET) | ||
set_configure_variable(WITH_SQLITE USE_SQLITE) | ||
set_configure_variable(WITH_BDB USE_BDB) | ||
set_configure_variable(BUILD_CLI BUILD_BITCOIN_CLI) | ||
set_configure_variable(BUILD_UTIL BUILD_BITCOIN_UTIL) | ||
set_configure_variable(BUILD_WALLET_TOOL BUILD_BITCOIN_WALLET) | ||
set_configure_variable(BUILD_DAEMON BUILD_BITCOIND_TRUE) | ||
set_configure_variable(WITH_ZMQ ENABLE_ZMQ) | ||
set_configure_variable(ENABLE_EXTERNAL_SIGNER ENABLE_EXTERNAL_SIGNER) | ||
set_configure_variable(USE_SYSCALL_SANDBOX ENABLE_SYSCALL_SANDBOX) | ||
set_configure_variable(ENABLE_TRACING ENABLE_USDT_TRACEPOINTS) | ||
|
||
configure_file(config.ini.in config.ini @ONLY) | ||
endfunction() | ||
|
||
create_test_config() | ||
|
||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/functional) | ||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/fuzz) | ||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/util) | ||
|
||
function(create_test_script script) | ||
if(MSVC) | ||
file(CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/${script} ${CMAKE_CURRENT_BINARY_DIR}/${script} COPY_ON_ERROR) | ||
elseif(CMAKE_VERSION VERSION_GREATER_EQUAL 3.14) | ||
file(CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/${script} ${CMAKE_CURRENT_BINARY_DIR}/${script} COPY_ON_ERROR SYMBOLIC) | ||
else() | ||
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/${script}) | ||
execute_process(COMMAND ln -s ${CMAKE_CURRENT_SOURCE_DIR}/${script} ${CMAKE_CURRENT_BINARY_DIR}/${script}) | ||
endif() | ||
endfunction() | ||
|
||
foreach(script functional/test_runner.py fuzz/test_runner.py util/rpcauth-test.py util/test_runner.py) | ||
create_test_script(${script}) | ||
endforeach() |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Afaict these last three are still missing, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
ENABLE_EXTERNAL_SIGNER
anUSE_SYSCALL_SANDBOX
variables are not introduced in this PR. As forENABLE_TRACING
, seebitcoin/cmake/optional.cmake
Lines 90 to 108 in 2d8930e
Anyway, the processing of the
test/config.ini.in
file expects all three variables set:ENABLE_EXTERNAL_SIGNER_TRUE
ENABLE_SYSCALL_SANDBOX_TRUE
ENABLE_USDT_TRACEPOINTS_TRUE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, all good then :)