vcpkg_execute_build_process.cmake: Check if the exit code is a string (#28405)

Co-authored-by: Cheney-Wang <850426846@qq.com>
This commit is contained in:
autoantwort 2023-01-12 01:13:00 +01:00 committed by GitHub
parent c30de8e136
commit 0960ce8c46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,7 +53,10 @@ function(vcpkg_execute_build_process)
ERROR_FILE "${log_err}"
RESULT_VARIABLE error_code
)
if (NOT error_code MATCHES "^[0-9]+$")
list(JOIN arg_COMMAND " " command)
message(FATAL_ERROR "Failed to execute command \"${command}\" in working directory \"${arg_WORKING_DIRECTORY}\": ${error_code}")
endif()
if(NOT error_code EQUAL "0")
file(READ "${log_out}" out_contents)
file(READ "${log_err}" err_contents)