[vcpkg_execute_*_process] Add support for build profiling (#22676)

Use --x-cmake-args=-DX_PORT_PROFILE=TRUE to enable port build profiling
This commit is contained in:
Max Khon 2022-06-10 20:56:44 +03:00 committed by GitHub
parent d6541fff4b
commit 2e4c6df44c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 0 deletions

View File

@ -37,6 +37,13 @@ function(vcpkg_execute_build_process)
set(log_err "${log_prefix}-err.log")
set(all_logs "${log_out}" "${log_err}")
if(X_PORT_PROFILE)
vcpkg_list(PREPEND arg_COMMAND "${CMAKE_COMMAND}" "-E" "time")
if(DEFINED arg_NO_PARALLEL_COMMAND)
vcpkg_list(PREPEND arg_NO_PARALLEL_COMMAND "${CMAKE_COMMAND}" "-E" "time")
endif()
endif()
execute_process(
COMMAND ${arg_COMMAND}
WORKING_DIRECTORY "${arg_WORKING_DIRECTORY}"

View File

@ -51,6 +51,10 @@ Halting portfile execution.
endif()
endif()
if(X_PORT_PROFILE AND NOT arg_ALLOW_IN_DOWNLOAD_MODE)
vcpkg_list(PREPEND arg_COMMAND "${CMAKE_COMMAND}" "-E" "time")
endif()
vcpkg_execute_in_download_mode(
COMMAND ${arg_COMMAND}
OUTPUT_FILE "${log_out}"

View File

@ -27,6 +27,10 @@ Halting portfile execution.
]])
endif()
if(X_PORT_PROFILE AND NOT arg_ALLOW_IN_DOWNLOAD_MODE)
vcpkg_list(PREPEND arg_COMMAND "${CMAKE_COMMAND}" "-E" "time")
endif()
set(all_logs "")
foreach(loop_count RANGE 1 ${arg_COUNT})
set(out_log "${CURRENT_BUILDTREES_DIR}/${arg_LOGNAME}-out-${loop_count}.log")