From 253a691441ddb04eac2b318112064e69f4b837b7 Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Tue, 10 Sep 2024 15:16:28 +0200 Subject: [PATCH] build: drop superfluous `HAVE_BUILD_INFO` define build.h should always be generated before clientversion.cpp is compiled due to the following explicit dependency in src/CMakeLists.txt: add_dependencies(bitcoin_clientversion generate_build_info) Hence there is no need to gate the inclusion of that header with an extra define. --- src/CMakeLists.txt | 4 ---- src/clientversion.cpp | 2 -- 2 files changed, 6 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 42ac1aba732b4..f41fffd6a4f43 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -17,10 +17,6 @@ add_custom_target(generate_build_info add_library(bitcoin_clientversion OBJECT EXCLUDE_FROM_ALL clientversion.cpp ) -target_compile_definitions(bitcoin_clientversion - PRIVATE - HAVE_BUILD_INFO -) target_link_libraries(bitcoin_clientversion PRIVATE core_interface diff --git a/src/clientversion.cpp b/src/clientversion.cpp index 45d4ec57d0577..5514631faa88d 100644 --- a/src/clientversion.cpp +++ b/src/clientversion.cpp @@ -23,14 +23,12 @@ using util::Join; const std::string CLIENT_NAME("Satoshi"); -#ifdef HAVE_BUILD_INFO #include // The , which is generated by the build environment (cmake/script/GenerateBuildInfo.cmake), // could contain only one line of the following: // - "#define BUILD_GIT_TAG ...", if the top commit is tagged // - "#define BUILD_GIT_COMMIT ...", if the top commit is not tagged // - "// No build information available", if proper git information is not available -#endif //! git will put "#define GIT_COMMIT_ID ..." on the next line inside archives. $Format:%n#define GIT_COMMIT_ID "%H"$