mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 07:09:15 +01:00
56750c4f87iwyu, clang-format: Sort includes (Hennadii Stepanov)2c78814e0eci: Add IWYU job (Hennadii Stepanov)94e4f04d7ccmake: Fix target name (Hennadii Stepanov)0f81e00519cmake: Make `codegen` target dependent on `generate_build_info` (Hennadii Stepanov)73f7844cdbiwyu: Add patch to prefer C++ headers over C counterparts (Hennadii Stepanov)7a65437e23iwyu: Add patch to prefer angled brackets over quotes for includes (Hennadii Stepanov) Pull request description: This PR separates the IWYU checks into its own CI job to provide faster feedback to developers. No other changes are made to the treatment of IWYU warnings. The existing “tidy” CI job will no longer run IWYU. See also the discussion of https://github.com/bitcoin/bitcoin/pull/33779, specifically this [comment](https://github.com/bitcoin/bitcoin/pull/33779#issuecomment-3491515263): > Maybe a better approach would be to run the enforced sections in a separate, faster job? Some of the linters are already a bit annoying to invoke locally, so I usually just run the lint job. Doing the same for the includes seems fine to me. Based on ideas from https://github.com/bitcoin/bitcoin/pull/32953. ACKs for top commit: maflcko: review ACK56750c4f87🌄 sedited: ACK56750c4f87Tree-SHA512: af15326b6d0c5d1e11346ac64939644936c65eb9466cd1a17ab5da347d39aef10f7ab33b39fbca31ad291b0b4b54639b147b24410f4f86197e4a776049882694
39 lines
2.1 KiB
CMake
39 lines
2.1 KiB
CMake
# Copyright (c) 2025-present 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(mptest PROPERTIES EXCLUDE_FROM_ALL OFF)
|
|
endif()
|
|
# Exclude examples from compilation database, because the examples are not
|
|
# built by default, and they contain generated c++ code. Without this
|
|
# exclusion, tools like clang-tidy and IWYU that make use of compilation
|
|
# database would complain that the generated c++ source files do not exist. An
|
|
# alternate fix could build "mpexamples" by default like "mptests" above.
|
|
set_target_properties(mpcalculator mpprinter mpexample PROPERTIES EXPORT_COMPILE_COMMANDS OFF)
|
|
endfunction()
|