From db240cf6d093a300d880469dbae78b0bdd9e9433 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sun, 28 Apr 2024 10:35:05 +0100 Subject: [PATCH 1/3] fixup! cmake: Add `config/bitcoin-config.h` support Adjust copyright header. --- cmake/bitcoin-config.h.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmake/bitcoin-config.h.in b/cmake/bitcoin-config.h.in index 70ac84bed647e..9951cd0874ea3 100644 --- a/cmake/bitcoin-config.h.in +++ b/cmake/bitcoin-config.h.in @@ -1,9 +1,8 @@ -// Copyright (c) 2023 The Bitcoin Core developers +// Copyright (c) 2023-present The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. +// file COPYING or https://opensource.org/license/mit/. #ifndef BITCOIN_CONFIG_H - #define BITCOIN_CONFIG_H /* Version Build */ From b8936d314f90375e2b55a3e70702534e954d24ea Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sun, 28 Apr 2024 10:25:31 +0100 Subject: [PATCH 2/3] cmake, lint: Adjust `lint_includes_build_config` --- test/lint/test_runner/src/main.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/test/lint/test_runner/src/main.rs b/test/lint/test_runner/src/main.rs index d5dd98effe2b7..4a882cb4cf36e 100644 --- a/test/lint/test_runner/src/main.rs +++ b/test/lint/test_runner/src/main.rs @@ -177,20 +177,14 @@ Please add any false positives, such as subtrees, or externally sourced files to } fn lint_includes_build_config() -> LintResult { - let config_path = "./src/config/bitcoin-config.h.in"; - if !Path::new(config_path).is_file() { - assert!(Command::new("./autogen.sh") - .status() - .expect("command error") - .success()); - } + let config_path = "./cmake/bitcoin-config.h.in"; let defines_regex = format!( r"^\s*(?!//).*({})", - check_output(Command::new("grep").args(["undef ", "--", config_path])) + check_output(Command::new("grep").args(["define", "--", config_path])) .expect("grep failed") .lines() .map(|line| { - line.split("undef ") + line.split_whitespace() .nth(1) .unwrap_or_else(|| panic!("Could not extract name in line: {line}")) }) From 61735efca2c35c07af1e20a2860411141fc265e1 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sun, 28 Apr 2024 10:27:22 +0100 Subject: [PATCH 3/3] Remove unused `#include ` CMake allows to incorporate compile defines into a target as its property with applying automatically where required. --- src/crypto/sha256.cpp | 2 -- src/httpserver.cpp | 2 -- src/qt/qrimagewidget.cpp | 2 -- src/qt/receiverequestdialog.cpp | 2 -- src/test/util_threadnames_tests.cpp | 2 -- 5 files changed, 10 deletions(-) diff --git a/src/crypto/sha256.cpp b/src/crypto/sha256.cpp index c883bd2f03f2f..f744d73556b12 100644 --- a/src/crypto/sha256.cpp +++ b/src/crypto/sha256.cpp @@ -2,8 +2,6 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include // IWYU pragma: keep - #include #include diff --git a/src/httpserver.cpp b/src/httpserver.cpp index b1d4dc9234788..7843b183db923 100644 --- a/src/httpserver.cpp +++ b/src/httpserver.cpp @@ -2,8 +2,6 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include // IWYU pragma: keep - #include #include diff --git a/src/qt/qrimagewidget.cpp b/src/qt/qrimagewidget.cpp index f6e712a047a3e..9aa2db9cd97c3 100644 --- a/src/qt/qrimagewidget.cpp +++ b/src/qt/qrimagewidget.cpp @@ -15,8 +15,6 @@ #include #include -#include // IWYU pragma: keep - #ifdef USE_QRCODE #include #endif diff --git a/src/qt/receiverequestdialog.cpp b/src/qt/receiverequestdialog.cpp index b4322ddc0f436..a3528d7e0069e 100644 --- a/src/qt/receiverequestdialog.cpp +++ b/src/qt/receiverequestdialog.cpp @@ -14,8 +14,6 @@ #include #include -#include // IWYU pragma: keep - ReceiveRequestDialog::ReceiveRequestDialog(QWidget* parent) : QDialog(parent, GUIUtil::dialog_flags), ui(new Ui::ReceiveRequestDialog) diff --git a/src/test/util_threadnames_tests.cpp b/src/test/util_threadnames_tests.cpp index df5b1a4461d77..536121d9a61c7 100644 --- a/src/test/util_threadnames_tests.cpp +++ b/src/test/util_threadnames_tests.cpp @@ -11,8 +11,6 @@ #include #include -#include // IWYU pragma: keep - #include BOOST_AUTO_TEST_SUITE(util_threadnames_tests)