Skip to content

Commit

Permalink
Merge #333: cmake: Do not re-write obj/build.h unnecessarily
Browse files Browse the repository at this point in the history
ef1744a fixup! cmake: Add `GenerateBuildInfo.cmake` script (Hennadii Stepanov)

Pull request description:

ACKs for top commit:
  TheCharlatan:
    ACK ef1744a

Tree-SHA512: 57d6d41dbde75c18775ae9c46dd3c9063f39b2162941bbb852876b4b30c3c8ecfbe1f052d8c19ca34a92673ff644e3e252dd77b982c1c8f5bf6d951c9e994689
  • Loading branch information
hebasto committed Aug 16, 2024
2 parents 71384da + ef1744a commit 8f4e5b0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmake/script/GenerateBuildInfo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ if(NOT "$ENV{BITCOIN_GENBUILD_NO_GIT}" STREQUAL "1")
endif()

if(GIT_TAG)
set(NEWINFO "#define BUILD_GIT_TAG \"${GIT_TAG}\"\n")
set(NEWINFO "#define BUILD_GIT_TAG \"${GIT_TAG}\"")
elseif(GIT_COMMIT)
set(NEWINFO "#define BUILD_GIT_COMMIT \"${GIT_COMMIT}\"\n")
set(NEWINFO "#define BUILD_GIT_COMMIT \"${GIT_COMMIT}\"")
else()
set(NEWINFO "// No build information available\n")
set(NEWINFO "// No build information available")
endif()

# Only update the header if necessary.
if(NOT "${INFO}" STREQUAL "${NEWINFO}")
file(WRITE ${BUILD_INFO_HEADER_PATH} ${NEWINFO})
file(WRITE ${BUILD_INFO_HEADER_PATH} "${NEWINFO}\n")
endif()

0 comments on commit 8f4e5b0

Please sign in to comment.