[vcpkg] collect error logs in logs.txt in the buildtrees folder (#22146)

* collect error logs in logs.txt in the buildtrees folder

* Use global variable

* rename file to error-logs-.txt and remove error: prefix in file
This commit is contained in:
autoantwort 2022-01-28 20:30:49 +01:00 committed by GitHub
parent dd42206f86
commit 6ba505cf2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 0 deletions

View File

@ -151,6 +151,7 @@ function(vcpkg_execute_build_process)
if(NOT log_size EQUAL "0")
file(TO_NATIVE_PATH "${log}" native_log)
string(APPEND stringified_logs " ${native_log}\n")
file(APPEND "${Z_VCPKG_ERROR_LOG_COLLECTION_FILE}" "${native_log}\n")
endif()
endforeach()
z_vcpkg_prettify_command_line(pretty_command ${arg_COMMAND})

View File

@ -120,6 +120,7 @@ Halting portfile execution.
if(NOT log_size EQUAL "0")
file(TO_NATIVE_PATH "${log}" native_log)
string(APPEND stringified_logs " ${native_log}\n")
file(APPEND "${Z_VCPKG_ERROR_LOG_COLLECTION_FILE}" "${native_log}\n")
endif()
endforeach()

View File

@ -139,6 +139,9 @@ if(CMD MATCHES "^BUILD$")
set(TRIPLET_SYSTEM_ARCH "${VCPKG_TARGET_ARCHITECTURE}")
include("${SCRIPTS}/cmake/vcpkg_common_definitions.cmake")
set(Z_VCPKG_ERROR_LOG_COLLECTION_FILE "${CURRENT_BUILDTREES_DIR}/error-logs-${TARGET_TRIPLET}.txt")
file(REMOVE "${Z_VCPKG_ERROR_LOG_COLLECTION_FILE}")
include("${CURRENT_PORT_DIR}/portfile.cmake")
if(DEFINED PORT)
include("${SCRIPTS}/build_info.cmake")