Skip to content

Commit

Permalink
fixup! cmake: Add GenerateBuildInfo.cmake script
Browse files Browse the repository at this point in the history
Do not re-write `obj/build.h` unnecessarily.
  • Loading branch information
hebasto committed Aug 16, 2024
1 parent 71384da commit ef1744a
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 ef1744a

Please sign in to comment.