Skip to content

Commit

Permalink
build: drop superfluous HAVE_BUILD_INFO define
Browse files Browse the repository at this point in the history
bitcoin-build-info.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.
  • Loading branch information
theStack committed Sep 19, 2024
1 parent 0dd6625 commit 7025942
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
4 changes: 0 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/clientversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,12 @@ using util::Join;
const std::string CLIENT_NAME("Satoshi");


#ifdef HAVE_BUILD_INFO
#include <bitcoin-build-info.h>
// The <bitcoin-build-info.h>, 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"$

Expand Down

0 comments on commit 7025942

Please sign in to comment.