mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
This change is technically not needed to add libmultiprocess as a subtree, but it avoids a CI failure in followup PR #30975 which enables multiprocess build option in more CI jobs. In that PR, several jobs fail due to the mptest executable not being built by default, as reported https://github.com/bitcoin/bitcoin/pull/30975#issuecomment-2623801480 Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
32 lines
1.7 KiB
CMake
32 lines
1.7 KiB
CMake
# Copyright (c) 2025 The Bitcoin Core developers
|
|
# Distributed under the MIT software license, see the accompanying
|
|
# file COPYING or https://opensource.org/license/mit/.
|
|
|
|
function(add_libmultiprocess subdir)
|
|
# Set BUILD_TESTING to match BUILD_TESTS. BUILD_TESTING is a standard cmake
|
|
# option that controls whether enable_testing() is called, but in the bitcoin
|
|
# build a BUILD_TESTS option is used instead.
|
|
set(BUILD_TESTING "${BUILD_TESTS}")
|
|
add_subdirectory(${subdir} EXCLUDE_FROM_ALL)
|
|
# Apply core_interface compile options to libmultiprocess runtime library.
|
|
target_link_libraries(multiprocess PUBLIC $<BUILD_INTERFACE:core_interface>)
|
|
target_link_libraries(mputil PUBLIC $<BUILD_INTERFACE:core_interface>)
|
|
target_link_libraries(mpgen PUBLIC $<BUILD_INTERFACE:core_interface>)
|
|
# Mark capproto options as advanced to hide by default from cmake UI
|
|
mark_as_advanced(CapnProto_DIR)
|
|
mark_as_advanced(CapnProto_capnpc_IMPORTED_LOCATION)
|
|
mark_as_advanced(CapnProto_capnp_IMPORTED_LOCATION)
|
|
mark_as_advanced(CapnProto_capnp-json_IMPORTED_LOCATION)
|
|
mark_as_advanced(CapnProto_capnp-rpc_IMPORTED_LOCATION)
|
|
mark_as_advanced(CapnProto_capnp-websocket_IMPORTED_LOCATION)
|
|
mark_as_advanced(CapnProto_kj-async_IMPORTED_LOCATION)
|
|
mark_as_advanced(CapnProto_kj-gzip_IMPORTED_LOCATION)
|
|
mark_as_advanced(CapnProto_kj-http_IMPORTED_LOCATION)
|
|
mark_as_advanced(CapnProto_kj_IMPORTED_LOCATION)
|
|
mark_as_advanced(CapnProto_kj-test_IMPORTED_LOCATION)
|
|
mark_as_advanced(CapnProto_kj-tls_IMPORTED_LOCATION)
|
|
if(BUILD_TESTS)
|
|
# Add tests to "all" target so ctest can run them
|
|
set_target_properties(mptests PROPERTIES EXCLUDE_FROM_ALL OFF)
|
|
endif()
|
|
endfunction()
|