mirror of
https://github.com/cemu-project/vcpkg.git
synced 2025-01-24 20:47:00 +00:00
[vcpkg] Use spaces instead of semicolons in the output (#7080)
* Use spaces instead of semicolons in the output * Add prettify_command macro * Move pretty_command macro to a separate file
This commit is contained in:
parent
77cfd20b83
commit
b26cb1a041
@ -32,3 +32,4 @@ include(vcpkg_get_windows_sdk)
|
||||
include(vcpkg_replace_string)
|
||||
include(vcpkg_from_git)
|
||||
include(vcpkg_test_cmake)
|
||||
include(vcpkg_prettify_command)
|
||||
|
@ -31,6 +31,7 @@
|
||||
## ## Examples
|
||||
##
|
||||
## * [icu](https://github.com/Microsoft/vcpkg/blob/master/ports/icu/portfile.cmake)
|
||||
include(vcpkg_prettify_command)
|
||||
function(vcpkg_execute_build_process)
|
||||
cmake_parse_arguments(_ebp "" "WORKING_DIRECTORY;LOGNAME" "COMMAND;NO_PARALLEL_COMMAND" ${ARGN})
|
||||
|
||||
@ -131,8 +132,9 @@ function(vcpkg_execute_build_process)
|
||||
file(TO_NATIVE_PATH "${LOG}" NATIVE_LOG)
|
||||
list(APPEND STRINGIFIED_LOGS " ${NATIVE_LOG}\n")
|
||||
endforeach()
|
||||
vcpkg_prettify_command(_ebp_COMMAND _ebp_COMMAND_PRETTY)
|
||||
message(FATAL_ERROR
|
||||
" Command failed: ${_ebp_COMMAND}\n"
|
||||
" Command failed: ${_ebp_COMMAND_PRETTY}\n"
|
||||
" Working Directory: ${_ebp_WORKING_DIRECTORY}\n"
|
||||
" See logs for more information:\n"
|
||||
${STRINGIFIED_LOGS})
|
||||
|
@ -28,6 +28,7 @@
|
||||
## * [openssl](https://github.com/Microsoft/vcpkg/blob/master/ports/openssl/portfile.cmake)
|
||||
## * [boost](https://github.com/Microsoft/vcpkg/blob/master/ports/boost/portfile.cmake)
|
||||
## * [qt5](https://github.com/Microsoft/vcpkg/blob/master/ports/qt5/portfile.cmake)
|
||||
include(vcpkg_prettify_command)
|
||||
function(vcpkg_execute_required_process)
|
||||
cmake_parse_arguments(vcpkg_execute_required_process "" "WORKING_DIRECTORY;LOGNAME" "COMMAND" ${ARGN})
|
||||
set(LOG_OUT "${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_LOGNAME}-out.log")
|
||||
@ -53,8 +54,9 @@ function(vcpkg_execute_required_process)
|
||||
file(TO_NATIVE_PATH "${LOG}" NATIVE_LOG)
|
||||
list(APPEND STRINGIFIED_LOGS " ${NATIVE_LOG}\n")
|
||||
endforeach()
|
||||
vcpkg_prettify_command(vcpkg_execute_required_process_COMMAND vcpkg_execute_required_process_COMMAND_PRETTY)
|
||||
message(FATAL_ERROR
|
||||
" Command failed: ${vcpkg_execute_required_process_COMMAND}\n"
|
||||
" Command failed: ${vcpkg_execute_required_process_COMMAND_PRETTY}\n"
|
||||
" Working Directory: ${vcpkg_execute_required_process_WORKING_DIRECTORY}\n"
|
||||
" Error code: ${error_code}\n"
|
||||
" See logs for more information:\n"
|
||||
|
@ -1,4 +1,5 @@
|
||||
# Usage: vcpkg_execute_required_process_repeat(COUNT <num> COMMAND <cmd> [<args>...] WORKING_DIRECTORY </path/to/dir> LOGNAME <my_log_name>)
|
||||
include(vcpkg_prettify_command)
|
||||
function(vcpkg_execute_required_process_repeat)
|
||||
cmake_parse_arguments(vcpkg_execute_required_process_repeat "" "COUNT;WORKING_DIRECTORY;LOGNAME" "COMMAND" ${ARGN})
|
||||
#debug_message("vcpkg_execute_required_process_repeat(${vcpkg_execute_required_process_repeat_COMMAND})")
|
||||
@ -18,8 +19,9 @@ function(vcpkg_execute_required_process_repeat)
|
||||
endif()
|
||||
endforeach(loop_count)
|
||||
if (NOT SUCCESSFUL_EXECUTION)
|
||||
vcpkg_prettify_command(vcpkg_execute_required_process_repeat_COMMAND vcpkg_execute_required_process_repeat_COMMAND_PRETTY)
|
||||
message(FATAL_ERROR
|
||||
" Command failed: ${vcpkg_execute_required_process_repeat_COMMAND}\n"
|
||||
" Command failed: ${vcpkg_execute_required_process_repeat_COMMAND_PRETTY}\n"
|
||||
" Working Directory: ${vcpkg_execute_required_process_repeat_WORKING_DIRECTORY}\n"
|
||||
" See logs for more information:\n"
|
||||
" ${NATIVE_BUILDTREES_DIR}\\${vcpkg_execute_required_process_repeat_LOGNAME}-out.log\n"
|
||||
|
26
scripts/cmake/vcpkg_prettify_command.cmake
Normal file
26
scripts/cmake/vcpkg_prettify_command.cmake
Normal file
@ -0,0 +1,26 @@
|
||||
## # vcpkg_prettify_command
|
||||
##
|
||||
## Turns list of command arguments into a formatted string.
|
||||
##
|
||||
## ## Usage
|
||||
## ```cmake
|
||||
## vcpkg_prettify_command()
|
||||
## ```
|
||||
##
|
||||
## ## Examples
|
||||
##
|
||||
## * `scripts/cmake/vcpkg_execute_build_process.cmake`
|
||||
## * `scripts/cmake/vcpkg_execute_required_process.cmake`
|
||||
## * `scripts/cmake/vcpkg_execute_required_process_repeat.cmake`
|
||||
|
||||
macro(vcpkg_prettify_command INPUT_VAR OUTPUT_VAR)
|
||||
set(${OUTPUT_VAR} "")
|
||||
foreach(v ${${INPUT_VAR}})
|
||||
if(${v} MATCHES "( )")
|
||||
list(APPEND ${OUTPUT_VAR} \"${v}\")
|
||||
else()
|
||||
list(APPEND ${OUTPUT_VAR} ${v})
|
||||
endif()
|
||||
endforeach()
|
||||
list(JOIN ${OUTPUT_VAR} " " ${OUTPUT_VAR})
|
||||
endmacro()
|
Loading…
x
Reference in New Issue
Block a user