mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 10:21:07 +08:00
need a function to repeatedly build up to a number of failures, since qt builds are so flaky
This commit is contained in:
parent
7e19b17a07
commit
162ba52f43
@ -21,8 +21,6 @@ if (EXISTS ${CURRENT_BUILDTREES_DIR}/src/qt-everywhere-opensource-src-5.7.0)
|
||||
endif()
|
||||
|
||||
file(MAKE_DIRECTORY ${OUTPUT_PATH})
|
||||
message(STATUS "Configuring ${TARGET_TRIPLET}")
|
||||
|
||||
if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL static)
|
||||
list(APPEND QT_RUNTIME_LINKAGE "-static")
|
||||
list(APPEND QT_RUNTIME_LINKAGE "-static-runtime")
|
||||
@ -37,9 +35,10 @@ else()
|
||||
)
|
||||
endif()
|
||||
|
||||
message(STATUS "Configuring ${TARGET_TRIPLET}")
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND "${SOURCE_PATH}/configure.bat"
|
||||
-confirm-license -opensource -developer-build -platform win32-msvc2015
|
||||
-confirm-license -opensource -platform win32-msvc2015
|
||||
-debug-and-release -force-debug-info ${QT_RUNTIME_LINKAGE}
|
||||
-nomake examples -nomake tests -skip webengine
|
||||
-prefix "${CURRENT_PACKAGES_DIR}"
|
||||
@ -49,7 +48,8 @@ vcpkg_execute_required_process(
|
||||
message(STATUS "Configure ${TARGET_TRIPLET} done")
|
||||
|
||||
message(STATUS "Building ${TARGET_TRIPLET}")
|
||||
vcpkg_execute_required_process(
|
||||
vcpkg_execute_required_process_repeat(
|
||||
COUNT 5
|
||||
COMMAND ${JOM}
|
||||
WORKING_DIRECTORY ${OUTPUT_PATH}
|
||||
LOGNAME build-${TARGET_TRIPLET}
|
||||
@ -71,19 +71,21 @@ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin)
|
||||
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/cmake ${CURRENT_PACKAGES_DIR}/share/cmake)
|
||||
|
||||
file(INSTALL ${CURRENT_PACKAGES_DIR}/bin
|
||||
DESTINATION ${CURRENT_PACKAGES_DIR}/debug
|
||||
FILES_MATCHING PATTERN "*d.dll"
|
||||
)
|
||||
file(INSTALL ${CURRENT_PACKAGES_DIR}/bin
|
||||
DESTINATION ${CURRENT_PACKAGES_DIR}/debug
|
||||
FILES_MATCHING PATTERN "*d.pdb"
|
||||
)
|
||||
file(GLOB DEBUG_BIN_FILES "${CURRENT_PACKAGES_DIR}/bin/*d.dll")
|
||||
file(REMOVE ${DEBUG_BIN_FILES})
|
||||
file(GLOB DEBUG_BIN_FILES "${CURRENT_PACKAGES_DIR}/bin/*d.pdb")
|
||||
file(REMOVE ${DEBUG_BIN_FILES})
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/Qt5Gamepad.dll ${CURRENT_PACKAGES_DIR}/bin/Qt5Gamepad.dll)
|
||||
if(DEFINED VCPKG_CRT_LINKAGE AND VCPKG_CRT_LINKAGE STREQUAL dynamic)
|
||||
file(INSTALL ${CURRENT_PACKAGES_DIR}/bin
|
||||
DESTINATION ${CURRENT_PACKAGES_DIR}/debug
|
||||
FILES_MATCHING PATTERN "*d.dll"
|
||||
)
|
||||
file(INSTALL ${CURRENT_PACKAGES_DIR}/bin
|
||||
DESTINATION ${CURRENT_PACKAGES_DIR}/debug
|
||||
FILES_MATCHING PATTERN "*d.pdb"
|
||||
)
|
||||
file(GLOB DEBUG_BIN_FILES "${CURRENT_PACKAGES_DIR}/bin/*d.dll")
|
||||
file(REMOVE ${DEBUG_BIN_FILES})
|
||||
file(GLOB DEBUG_BIN_FILES "${CURRENT_PACKAGES_DIR}/bin/*d.pdb")
|
||||
file(REMOVE ${DEBUG_BIN_FILES})
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/Qt5Gamepad.dll ${CURRENT_PACKAGES_DIR}/bin/Qt5Gamepad.dll)
|
||||
endif()
|
||||
|
||||
file(INSTALL ${CURRENT_PACKAGES_DIR}/lib
|
||||
DESTINATION ${CURRENT_PACKAGES_DIR}/debug
|
||||
@ -133,4 +135,5 @@ file(RENAME ${CURRENT_PACKAGES_DIR}/phrasebooks ${SHARE_PATH}/phrasebooks)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/plugins ${SHARE_PATH}/plugins)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/qml ${SHARE_PATH}/qml)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/translations ${SHARE_PATH}/translations)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/qtvirtualkeyboard ${SHARE_PATH}/qtvirtualkeyboard)
|
||||
vcpkg_copy_pdbs()
|
||||
|
@ -1,10 +1,11 @@
|
||||
include(vcpkg_download_distfile)
|
||||
include(vcpkg_extract_source_archive)
|
||||
include(vcpkg_execute_required_process)
|
||||
include(vcpkg_execute_required_process_repeat)
|
||||
include(vcpkg_find_acquire_program)
|
||||
include(vcpkg_build_cmake)
|
||||
include(vcpkg_build_msbuild)
|
||||
include(vcpkg_install_cmake)
|
||||
include(vcpkg_configure_cmake)
|
||||
include(vcpkg_apply_patches)
|
||||
include(vcpkg_copy_pdbs)
|
||||
include(vcpkg_copy_pdbs)
|
||||
|
28
scripts/cmake/vcpkg_execute_required_process_repeat.cmake
Normal file
28
scripts/cmake/vcpkg_execute_required_process_repeat.cmake
Normal file
@ -0,0 +1,28 @@
|
||||
# Usage: vcpkg_execute_required_process_repeat(COUNT <num> COMMAND <cmd> [<args>...] WORKING_DIRECTORY </path/to/dir> LOGNAME <my_log_name>)
|
||||
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})")
|
||||
foreach(loop_count RANGE ${vcpkg_execute_required_process_repeat_COUNT})
|
||||
execute_process(
|
||||
COMMAND ${vcpkg_execute_required_process_repeat_COMMAND}
|
||||
OUTPUT_FILE ${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process_repeat_LOGNAME}-out.log
|
||||
ERROR_FILE ${CURRENT_BUILDTREES_DIR}/${vcpkg_execute_required_process__repeat_LOGNAME}-err.log
|
||||
RESULT_VARIABLE error_code
|
||||
WORKING_DIRECTORY ${vcpkg_execute_required_process_repeat_WORKING_DIRECTORY})
|
||||
#debug_message("error_code=${error_code}")
|
||||
file(TO_NATIVE_PATH "${CURRENT_BUILDTREES_DIR}" NATIVE_BUILDTREES_DIR)
|
||||
if(NOT error_code)
|
||||
set(SUCCESSFUL_EXECUTION TRUE)
|
||||
break()
|
||||
endif()
|
||||
endforeach(loop_count)
|
||||
if (NOT ${SUCCESSFUL_EXECUTION})
|
||||
message(FATAL_ERROR
|
||||
" Command failed: ${vcpkg_execute_required_process_repeat_COMMAND}\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"
|
||||
" ${NATIVE_BUILDTREES_DIR}\\${vcpkg_execute_required_process_repeat_LOGNAME}-err.log\n"
|
||||
)
|
||||
endif()
|
||||
endfunction()
|
@ -24,7 +24,7 @@ function(vcpkg_find_acquire_program VAR)
|
||||
set(ARCHIVE "yasm.exe")
|
||||
set(NOEXTRACT ON)
|
||||
set(HASH 850b26be5bbbdaeaf45ac39dd27f69f1a85e600c35afbd16b9f621396b3c7a19863ea3ff316b025b578fce0a8280eef2203306a2b3e46ee1389abb65313fb720)
|
||||
elseif(VAR MATCHES "JOM")
|
||||
elseif(VAR MATCHES "JOM")
|
||||
set(PROGNAME jom)
|
||||
set(PATHS ${DOWNLOADS}/tools/jom)
|
||||
set(URL "http://download.qt.io/official_releases/jom/jom_1_1_1.zip")
|
||||
|
Loading…
x
Reference in New Issue
Block a user