v29.4-roots.3 · Commit 1: [PATCH 01/30] build: port platform and dependency support
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. The two line-number columns refer to before and after.
cmake/script/GenerateBuildInfo.cmake
CHANGED
|
@@ -15,7 +15,8 @@ if(DEFINED BUILD_INFO_HEADER_PATH AND IS_ABSOLUTE "${BUILD_INFO_HEADER_PATH}")
|
|
|
15
15
|
file(STRINGS ${BUILD_INFO_HEADER_PATH} INFO LIMIT_COUNT 1)
|
|
16
16
|
endif()
|
|
17
17
|
else()
|
|
18
|
-
fatal_error()
|
|
18
|
+
unset(INFO)
|
|
19
|
+
set(BUILD_INFO_HEADER_PATH "/dev/stdout")
|
|
19
20
|
endif()
|
|
20
21
|
|
|
21
22
|
if(DEFINED SOURCE_DIR)
|
|
@@ -40,6 +41,22 @@ if(NOT "$ENV{BITCOIN_GENBUILD_NO_GIT}" STREQUAL "1")
|
|
|
40
41
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
41
42
|
ERROR_QUIET
|
|
42
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()
|
|
43
60
|
if(IS_INSIDE_WORK_TREE)
|
|
44
61
|
# Clean 'dirty' status of touched files that haven't been modified.
|
|
45
62
|
execute_process(
|
|
@@ -104,7 +121,9 @@ if(GIT_TAG)
|
|
|
104
121
|
elseif(GIT_COMMIT)
|
|
105
122
|
set(NEWINFO "#define BUILD_GIT_COMMIT \"${GIT_COMMIT}\"")
|
|
106
123
|
else()
|
|
107
|
-
set(NEWINFO "// No build information available")
|
|
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]])
|
|
108
127
|
endif()
|
|
109
128
|
|
|
110
129
|
# Only update the header if necessary.
|