[vcpkg] Better vcpkg_apply_patches error message (#10127)

This commit is contained in:
Leonid Pospelov 2020-02-28 00:22:16 +02:00 committed by GitHub
parent 4f46ab90fc
commit 81965f6b3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,13 +41,14 @@ function(vcpkg_apply_patches)
_execute_process(
COMMAND ${GIT} --work-tree=. --git-dir=.git apply "${ABSOLUTE_PATCH}" --ignore-whitespace --whitespace=nowarn --verbose
OUTPUT_FILE ${CURRENT_BUILDTREES_DIR}/${LOGNAME}-out.log
ERROR_FILE ${CURRENT_BUILDTREES_DIR}/${LOGNAME}-err.log
ERROR_VARIABLE error
WORKING_DIRECTORY ${_ap_SOURCE_PATH}
RESULT_VARIABLE error_code
)
file(WRITE "${CURRENT_BUILDTREES_DIR}/${LOGNAME}-err.log" "${error}")
if(error_code AND NOT _ap_QUIET)
message(FATAL_ERROR "Applying patch failed. Patch needs to be updated to work with source being used by vcpkg!")
message(FATAL_ERROR "Applying patch failed. ${error}")
endif()
math(EXPR PATCHNUM "${PATCHNUM}+1")