cmake: Move internal binaries from bin/ to libexec/
This change moves binaries that are not typically invoked directly by users from the `bin/` directory to the `libexec/` directory in CMake installs and binary releases. The goal is to simplify the contents of `bin/` for end users while still making all binaries available when needed. After this change, the binaries remaining in `bin/` are: - bitcoin - bitcoin-cli - bitcoind - bitcoin-qt - bitcoin-tx - bitcoin-util - bitcoin-wallet And the binaries that are moved to `libexec/` are: - bench_bitcoin - bitcoin-chainstate(*) - bitcoin-gui(***) - bitcoin-node(***) - test_bitcoin(**) - test_bitcoin-qt (*) bitcoin-chainstate was previously missing an install rule and was actually not installed even when it was enabled. (**) test_bitcoin is the only libexec/ binary that is currently included in bitcoin binary releases. The others are only installed when building from source with relevant cmake options enabled. (***) bitcoin-node and bitcoin-gui are not currently built by default or included in binary releases but both of these changes are planned and implemented in #31802
This commit is contained in:
1 parent
c540ede1cb
commit
cd97905ebc
9 files changed
+19
-13
No files matched your search
@@ -145,7 +145,7 @@ if [ "$RUN_UNIT_TESTS" = "true" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$RUN_UNIT_TESTS_SEQUENTIAL" = "true" ]; then
|
if [ "$RUN_UNIT_TESTS_SEQUENTIAL" = "true" ]; then
|
||||||
DIR_UNIT_TEST_DATA="${DIR_UNIT_TEST_DATA}" LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" "${BASE_OUTDIR}"/bin/test_bitcoin --catch_system_errors=no -l test_suite
|
DIR_UNIT_TEST_DATA="${DIR_UNIT_TEST_DATA}" LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" "${BASE_BUILD_DIR}"/bin/test_bitcoin --catch_system_errors=no -l test_suite
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$RUN_FUNCTIONAL_TESTS" = "true" ]; then
|
if [ "$RUN_FUNCTIONAL_TESTS" = "true" ]; then
|
||||||
|
|||||||
@@ -7,14 +7,19 @@ include(GNUInstallDirs)
|
|||||||
|
|
||||||
function(install_binary_component component)
|
function(install_binary_component component)
|
||||||
cmake_parse_arguments(PARSE_ARGV 1
|
cmake_parse_arguments(PARSE_ARGV 1
|
||||||
IC # prefix
|
IC # prefix
|
||||||
"HAS_MANPAGE" # options
|
"HAS_MANPAGE;INTERNAL" # options
|
||||||
"" # one_value_keywords
|
"" # one_value_keywords
|
||||||
"" # multi_value_keywords
|
"" # multi_value_keywords
|
||||||
)
|
)
|
||||||
set(target_name ${component})
|
set(target_name ${component})
|
||||||
|
if(IC_INTERNAL)
|
||||||
|
set(runtime_dest ${CMAKE_INSTALL_LIBEXECDIR})
|
||||||
|
else()
|
||||||
|
set(runtime_dest ${CMAKE_INSTALL_BINDIR})
|
||||||
|
endif()
|
||||||
install(TARGETS ${target_name}
|
install(TARGETS ${target_name}
|
||||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
RUNTIME DESTINATION ${runtime_dest}
|
||||||
COMPONENT ${component}
|
COMPONENT ${component}
|
||||||
)
|
)
|
||||||
if(INSTALL_MAN AND IC_HAS_MANPAGE)
|
if(INSTALL_MAN AND IC_HAS_MANPAGE)
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ mkdir -p "$DISTSRC"
|
|||||||
|
|
||||||
# Apply detached codesignatures (in-place)
|
# Apply detached codesignatures (in-place)
|
||||||
signapple apply dist/Bitcoin-Qt.app codesignatures/osx/"${HOST}"/dist/Bitcoin-Qt.app
|
signapple apply dist/Bitcoin-Qt.app codesignatures/osx/"${HOST}"/dist/Bitcoin-Qt.app
|
||||||
find "${DISTNAME}" -wholename "*/bin/*" -type f | while read -r bin
|
find "${DISTNAME}" \( -wholename "*/bin/*" -o -wholename "*/libexec/*" \) -type f | while read -r bin
|
||||||
do
|
do
|
||||||
signapple apply "${bin}" "codesignatures/osx/${HOST}/${bin}.${ARCH}sign"
|
signapple apply "${bin}" "codesignatures/osx/${HOST}/${bin}.${ARCH}sign"
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ ${SIGNAPPLE} apply "${UNSIGNED_BUNDLE}" "${OUTROOT}/${BUNDLE_ROOT}/${BUNDLE_NAME
|
|||||||
${SIGNAPPLE} notarize --detach "${OUTROOT}/${BUNDLE_ROOT}" --passphrase "${api_key_pass}" "$2" "$3" "${UNSIGNED_BUNDLE}"
|
${SIGNAPPLE} notarize --detach "${OUTROOT}/${BUNDLE_ROOT}" --passphrase "${api_key_pass}" "$2" "$3" "${UNSIGNED_BUNDLE}"
|
||||||
|
|
||||||
# Sign each binary
|
# Sign each binary
|
||||||
find . -maxdepth 3 -wholename "*/bin/*" -type f -exec realpath --relative-to=. {} \; | while read -r bin
|
find . -maxdepth 3 \( -wholename "*/bin/*" -o -wholename "*/libexec/*" \) -type f -exec realpath --relative-to=. {} \; | while read -r bin
|
||||||
do
|
do
|
||||||
bin_dir=$(dirname "${bin}")
|
bin_dir=$(dirname "${bin}")
|
||||||
bin_name=$(basename "${bin}")
|
bin_name=$(basename "${bin}")
|
||||||
|
|||||||
+2
-1
@@ -367,7 +367,7 @@ if(ENABLE_IPC AND BUILD_DAEMON)
|
|||||||
bitcoin_ipc
|
bitcoin_ipc
|
||||||
$<TARGET_NAME_IF_EXISTS:bitcoin_wallet>
|
$<TARGET_NAME_IF_EXISTS:bitcoin_wallet>
|
||||||
)
|
)
|
||||||
install_binary_component(bitcoin-node)
|
install_binary_component(bitcoin-node INTERNAL)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_IPC AND BUILD_TESTS)
|
if(ENABLE_IPC AND BUILD_TESTS)
|
||||||
@@ -469,6 +469,7 @@ if(BUILD_UTIL_CHAINSTATE)
|
|||||||
core_interface
|
core_interface
|
||||||
bitcoinkernel
|
bitcoinkernel
|
||||||
)
|
)
|
||||||
|
install_binary_component(bitcoin-chainstate INTERNAL)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -83,4 +83,4 @@ add_test(NAME bench_sanity_check
|
|||||||
COMMAND bench_bitcoin -sanity-check
|
COMMAND bench_bitcoin -sanity-check
|
||||||
)
|
)
|
||||||
|
|
||||||
install_binary_component(bench_bitcoin)
|
install_binary_component(bench_bitcoin INTERNAL)
|
||||||
@@ -282,7 +282,7 @@ if(ENABLE_IPC)
|
|||||||
bitcoin_ipc
|
bitcoin_ipc
|
||||||
)
|
)
|
||||||
import_plugins(bitcoin-gui)
|
import_plugins(bitcoin-gui)
|
||||||
install_binary_component(bitcoin-gui)
|
install_binary_component(bitcoin-gui INTERNAL)
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
set_target_properties(bitcoin-gui PROPERTIES WIN32_EXECUTABLE TRUE)
|
set_target_properties(bitcoin-gui PROPERTIES WIN32_EXECUTABLE TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -45,4 +45,4 @@ if(WIN32 AND VCPKG_TARGET_TRIPLET)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
install_binary_component(test_bitcoin-qt)
|
install_binary_component(test_bitcoin-qt INTERNAL)
|
||||||
@@ -213,4 +213,4 @@ endfunction()
|
|||||||
|
|
||||||
add_all_test_targets()
|
add_all_test_targets()
|
||||||
|
|
||||||
install_binary_component(test_bitcoin)
|
install_binary_component(test_bitcoin INTERNAL)
|
||||||
Reference in new issue
Block a user