v30.3-roots.1 · Commit 1: [PATCH 01/68] build: adapt Roots platform support to Core 30.3
cmake/script/GenerateBuildInfo.cmake
Before: cmake/script/GenerateBuildInfo.cmake · After: cmake/script/GenerateBuildInfo.cmake
File metadata
index d3ee2eb06210622bcf82a03249f1ca097feec760..baf589cac2b329798c36b3987b8c7b6cd34946dd 100644
Download original patch · Release notes
Diff rows 1–41 of 41. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. Before is on the left; after is on the right. Unified view fits narrow screens more easily.
cmake/script/GenerateBuildInfo.cmake
CHANGED
|
@@ -15,7 +15,8 @@ if(DEFINED BUILD_INFO_HEADER_PATH AND IS_ABSOLUTE "${BUILD_INFO_HEADER_PATH}")
|
|
| 15 |
file(STRINGS ${BUILD_INFO_HEADER_PATH} INFO LIMIT_COUNT 1)
|
| 16 |
endif()
|
| 17 |
else()
|
| 18 |
-
fatal_error()
|
|
|
|
| 19 |
endif()
|
| 20 |
|
| 21 |
if(DEFINED SOURCE_DIR)
|
|
@@ -40,6 +41,22 @@ if(NOT "$ENV{BITCOIN_GENBUILD_NO_GIT}" STREQUAL "1")
|
|
| 40 |
OUTPUT_STRIP_TRAILING_WHITESPACE
|
| 41 |
ERROR_QUIET
|
| 42 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
if(IS_INSIDE_WORK_TREE)
|
| 44 |
# Clean 'dirty' status of touched files that haven't been modified.
|
| 45 |
execute_process(
|
|
@@ -104,7 +121,9 @@ if(GIT_TAG)
|
|
| 104 |
elseif(GIT_COMMIT)
|
| 105 |
set(NEWINFO "#define BUILD_GIT_COMMIT \"${GIT_COMMIT}\"")
|
| 106 |
else()
|
| 107 |
-
set(NEWINFO "// No build information available")
|
|
|
|
|
|
|
| 108 |
endif()
|
| 109 |
|
| 110 |
# Only update the header if necessary.
|
|
|
|
| 15 |
file(STRINGS ${BUILD_INFO_HEADER_PATH} INFO LIMIT_COUNT 1)
|
| 16 |
endif()
|
| 17 |
else()
|
| 18 |
+
unset(INFO)
|
| 19 |
+
set(BUILD_INFO_HEADER_PATH "/dev/stdout")
|
| 20 |
endif()
|
| 21 |
|
| 22 |
if(DEFINED SOURCE_DIR)
|
|
|
|
| 41 |
OUTPUT_STRIP_TRAILING_WHITESPACE
|
| 42 |
ERROR_QUIET
|
| 43 |
)
|
| 44 |
+
if(IS_INSIDE_WORK_TREE)
|
| 45 |
+
# This check ensures that we are actually part of the intended git repository, and not just getting info about some unrelated git repository that the code happens to be in a directory under
|
| 46 |
+
execute_process(
|
| 47 |
+
COMMAND ${GIT_EXECUTABLE} status --porcelain -uall --ignored cmake/script/GenerateBuildInfo.cmake
|
| 48 |
+
WORKING_DIRECTORY ${WORKING_DIR}
|
| 49 |
+
RESULT_VARIABLE SCRIPT_STATUS_EXITCODE
|
| 50 |
+
OUTPUT_VARIABLE SCRIPT_STATUS
|
| 51 |
+
OUTPUT_STRIP_TRAILING_WHITESPACE
|
| 52 |
+
ERROR_QUIET
|
| 53 |
+
)
|
| 54 |
+
if(SCRIPT_STATUS_EXITCODE)
|
| 55 |
+
set(IS_INSIDE_WORK_TREE 0)
|
| 56 |
+
elseif(SCRIPT_STATUS MATCHES "\\?")
|
| 57 |
+
set(IS_INSIDE_WORK_TREE 0)
|
| 58 |
+
endif()
|
| 59 |
+
endif()
|
| 60 |
if(IS_INSIDE_WORK_TREE)
|
| 61 |
# Clean 'dirty' status of touched files that haven't been modified.
|
| 62 |
execute_process(
|
|
|
|
| 121 |
elseif(GIT_COMMIT)
|
| 122 |
set(NEWINFO "#define BUILD_GIT_COMMIT \"${GIT_COMMIT}\"")
|
| 123 |
else()
|
| 124 |
+
# NOTE: The NEWINFO line below this comment gets replaced by a string-match in contrib/guix/libexec/make_release_tarball.sh
|
| 125 |
+
# If changing it, update the script too!
|
| 126 |
+
set(NEWINFO [[// No build information available]])
|
| 127 |
endif()
|
| 128 |
|
| 129 |
# Only update the header if necessary.
|