Skip to content

Commit

Permalink
build: add bitcoin.exe to windows installer
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjors committed Jan 10, 2025
1 parent 044c112 commit 26d3a06
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions cmake/module/GenerateSetupNsi.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ function(generate_setup_nsi)
set(abs_top_builddir ${PROJECT_BINARY_DIR})
set(CLIENT_URL ${PROJECT_HOMEPAGE_URL})
set(CLIENT_TARNAME "bitcoin")
set(BITCOIN_WRAPPER_NAME "bitcoin")
set(BITCOIN_GUI_NAME "bitcoin-qt")
set(BITCOIN_DAEMON_NAME "bitcoind")
set(BITCOIN_CLI_NAME "bitcoin-cli")
Expand Down
5 changes: 3 additions & 2 deletions cmake/module/Maintenance.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function(add_maintenance_targets)
VERBATIM
)

foreach(target IN ITEMS bitcoind bitcoin-qt bitcoin-cli bitcoin-tx bitcoin-util bitcoin-wallet test_bitcoin bench_bitcoin)
foreach(target IN ITEMS bitcoin bitcoind bitcoin-qt bitcoin-cli bitcoin-tx bitcoin-util bitcoin-wallet test_bitcoin bench_bitcoin)
if(TARGET ${target})
list(APPEND executables $<TARGET_FILE:${target}>)
endif()
Expand All @@ -66,14 +66,15 @@ function(add_maintenance_targets)
endfunction()

function(add_windows_deploy_target)
if(MINGW AND TARGET bitcoin-qt AND TARGET bitcoind AND TARGET bitcoin-cli AND TARGET bitcoin-tx AND TARGET bitcoin-wallet AND TARGET bitcoin-util AND TARGET test_bitcoin)
if(MINGW AND TARGET bitcoin AND TARGET bitcoin-qt AND TARGET bitcoind AND TARGET bitcoin-cli AND TARGET bitcoin-tx AND TARGET bitcoin-wallet AND TARGET bitcoin-util AND TARGET test_bitcoin)
# TODO: Consider replacing this code with the CPack NSIS Generator.
# See https://cmake.org/cmake/help/latest/cpack_gen/nsis.html
include(GenerateSetupNsi)
generate_setup_nsi()
add_custom_command(
OUTPUT ${PROJECT_BINARY_DIR}/bitcoin-win64-setup.exe
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/release
COMMAND ${CMAKE_STRIP} $<TARGET_FILE:bitcoin> -o ${PROJECT_BINARY_DIR}/release/$<TARGET_FILE_NAME:bitcoin>
COMMAND ${CMAKE_STRIP} $<TARGET_FILE:bitcoin-qt> -o ${PROJECT_BINARY_DIR}/release/$<TARGET_FILE_NAME:bitcoin-qt>
COMMAND ${CMAKE_STRIP} $<TARGET_FILE:bitcoind> -o ${PROJECT_BINARY_DIR}/release/$<TARGET_FILE_NAME:bitcoind>
COMMAND ${CMAKE_STRIP} $<TARGET_FILE:bitcoin-cli> -o ${PROJECT_BINARY_DIR}/release/$<TARGET_FILE_NAME:bitcoin-cli>
Expand Down
1 change: 1 addition & 0 deletions share/setup.nsi.in
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ Section -Main SEC0000
SetOutPath $INSTDIR\share\rpcauth
File @abs_top_srcdir@/share/rpcauth/*.*
SetOutPath $INSTDIR\daemon
File @abs_top_builddir@/release/@BITCOIN_WRAPPER_NAME@@EXEEXT@
File @abs_top_builddir@/release/@BITCOIN_DAEMON_NAME@@EXEEXT@
File @abs_top_builddir@/release/@BITCOIN_CLI_NAME@@EXEEXT@
File @abs_top_builddir@/release/@BITCOIN_TX_NAME@@EXEEXT@
Expand Down
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ target_link_libraries(bitcoin_node
if(BUILD_BITCOIN_BIN)
add_executable(bitcoin bitcoin.cpp)
target_link_libraries(bitcoin core_interface bitcoin_util)
list(APPEND installable_targets bitcoin)
endif()

# Bitcoin Core bitcoind.
Expand Down

0 comments on commit 26d3a06

Please sign in to comment.