diff options
| author | myd7349 <myd7349@gmail.com> | 2019-06-23 08:16:07 +0800 |
|---|---|---|
| committer | myd7349 <myd7349@gmail.com> | 2019-06-23 08:16:07 +0800 |
| commit | 644851da5fbe46aadd0a8fa54e1d7d213f469fb0 (patch) | |
| tree | 3f5d20aca85fcf02375cf553e893c105758a5d39 /scripts | |
| parent | f1870ae02bedbaa5a501ddf3a7ba5d0a743a1053 (diff) | |
| parent | f3db66b403840b24ea2612d09cca30a5285f5ea3 (diff) | |
| download | vcpkg-644851da5fbe46aadd0a8fa54e1d7d213f469fb0.tar.gz vcpkg-644851da5fbe46aadd0a8fa54e1d7d213f469fb0.zip | |
Merge branch 'master' into sx-init
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/bootstrap.ps1 | 21 | ||||
| -rw-r--r-- | scripts/bootstrap.sh | 6 | ||||
| -rw-r--r-- | scripts/buildsystems/msbuild/applocal.ps1 | 4 | ||||
| -rw-r--r-- | scripts/buildsystems/osx/applocal.py | 420 | ||||
| -rw-r--r-- | scripts/buildsystems/vcpkg.cmake | 36 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_acquire_msys.cmake | 8 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_build_cmake.cmake | 133 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_build_qmake.cmake | 6 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_common_functions.cmake | 1 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_configure_cmake.cmake | 1 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_configure_meson.cmake | 2 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_execute_build_process.cmake | 141 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_find_acquire_program.cmake | 16 | ||||
| -rw-r--r-- | scripts/cmake/vcpkg_from_github.cmake | 2 | ||||
| -rw-r--r-- | scripts/toolchains/linux.cmake | 3 |
15 files changed, 654 insertions, 146 deletions
diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1 index 07a9fcbaa..6234efaa3 100644 --- a/scripts/bootstrap.ps1 +++ b/scripts/bootstrap.ps1 @@ -339,10 +339,16 @@ if ($disableMetrics) $platform = "x86" $vcpkgReleaseDir = "$vcpkgSourcesPath\msbuild.x86.release" - +if($PSVersionTable.PSVersion.Major -le 2) +{ + $architecture=(Get-WmiObject win32_operatingsystem | Select-Object osarchitecture).osarchitecture +} +else +{ + $architecture=(Get-CimInstance win32_operatingsystem | Select-Object osarchitecture).osarchitecture +} if ($win64) { - $architecture=(Get-WmiObject win32_operatingsystem | Select-Object osarchitecture).osarchitecture if (-not $architecture -like "*64*") { throw "Cannot build 64-bit on non-64-bit system" @@ -352,6 +358,15 @@ if ($win64) $vcpkgReleaseDir = "$vcpkgSourcesPath\msbuild.x64.release" } +if ($architecture -like "*64*") +{ + $PreferredToolArchitecture = "x64" +} +else +{ + $PreferredToolArchitecture = "x86" +} + $arguments = ( "`"/p:VCPKG_VERSION=-nohash`"", "`"/p:DISABLE_METRICS=$disableMetricsValue`"", @@ -359,7 +374,7 @@ $arguments = ( "/p:Platform=$platform", "/p:PlatformToolset=$platformToolset", "/p:TargetPlatformVersion=$windowsSDK", -"/p:PreferredToolArchitecture=x64", +"/p:PreferredToolArchitecture=$PreferredToolArchitecture", "/verbosity:minimal", "/m", "/nologo", diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 99d8dab68..b0e4f98a5 100644 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -100,7 +100,7 @@ vcpkgDownloadFile() url=$1; downloadPath=$2 sha512=$3 vcpkgCheckRepoTool "curl" rm -rf "$downloadPath.part" - curl -L $url --create-dirs --output "$downloadPath.part" || exit 1 + curl -L $url --create-dirs --retry 3 --output "$downloadPath.part" || exit 1 vcpkgCheckEqualFileHash $url "$downloadPath.part" $sha512 mv "$downloadPath.part" "$downloadPath" @@ -203,7 +203,9 @@ selectCXX() if [ "x$CXX" = "x" ]; then CXX=g++ - if which g++-8 >/dev/null 2>&1; then + if which g++-9 >/dev/null 2>&1; then + CXX=g++-9 + elif which g++-8 >/dev/null 2>&1; then CXX=g++-8 elif which g++-7 >/dev/null 2>&1; then CXX=g++-7 diff --git a/scripts/buildsystems/msbuild/applocal.ps1 b/scripts/buildsystems/msbuild/applocal.ps1 index cf363f12e..2fdd9fdb4 100644 --- a/scripts/buildsystems/msbuild/applocal.ps1 +++ b/scripts/buildsystems/msbuild/applocal.ps1 @@ -9,7 +9,7 @@ $g_is_debug = $g_install_root -match '(.*\\)?debug(\\)?$' # Ensure we create the copied files log, even if we don't end up copying any files if ($copiedFilesLog) { - Set-Content -Path $copiedFilesLog -Value "" -Encoding Ascii + Set-Content -Path $copiedFilesLog -Value "" -Encoding UTF8 } # Note: this function signature is depended upon by the qtdeploy.ps1 script introduced in 5.7.1-7 @@ -28,7 +28,7 @@ function deployBinary([string]$targetBinaryDir, [string]$SourceDir, [string]$tar Write-Verbose " ${targetBinaryName}: Copying $SourceDir\$targetBinaryName" Copy-Item "$SourceDir\$targetBinaryName" $targetBinaryDir } - if ($copiedFilesLog) { Add-Content $copiedFilesLog "$targetBinaryDir\$targetBinaryName" } + if ($copiedFilesLog) { Add-Content $copiedFilesLog "$targetBinaryDir\$targetBinaryName" -Encoding UTF8 } if ($tlogFile) { Add-Content $tlogFile "$targetBinaryDir\$targetBinaryName" } } diff --git a/scripts/buildsystems/osx/applocal.py b/scripts/buildsystems/osx/applocal.py new file mode 100644 index 000000000..b3f8f138e --- /dev/null +++ b/scripts/buildsystems/osx/applocal.py @@ -0,0 +1,420 @@ +#!/usr/bin/env python2 +# -*- coding: utf-8 -*- +""" +finish the job started by macdeployqtfix +from: https://github.com/arl/macdeployqtfix + +The MIT License (MIT) + +Copyright (c) 2015 Aurelien Rainone + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +""" + +from subprocess import Popen, PIPE +from string import Template +import os +import sys +import logging +import argparse +import re +from collections import namedtuple + + +QTLIB_NAME_REGEX = r'^(?:@executable_path)?/.*/(Qt[a-zA-Z]*).framework/(?:Versions/\d/)?\1$' +QTLIB_NORMALIZED = r'$prefix/Frameworks/$qtlib.framework/Versions/$qtversion/$qtlib' + +QTPLUGIN_NAME_REGEX = r'^(?:@executable_path)?/.*/[pP]lug[iI]ns/(.*)/(.*).dylib$' +QTPLUGIN_NORMALIZED = r'$prefix/PlugIns/$plugintype/$pluginname.dylib' + +LOADERPATH_REGEX = r'^@[a-z_]+path/(.*)' +LOADERPATH_NORMALIZED = r'$prefix/Frameworks/$loaderpathlib' + + +class GlobalConfig(object): + logger = None + qtpath = None + exepath = None + + +def run_and_get_output(popen_args): + """Run process and get all output""" + process_output = namedtuple('ProcessOutput', ['stdout', 'stderr', 'retcode']) + try: + GlobalConfig.logger.debug('run_and_get_output({0})'.format(repr(popen_args))) + + proc = Popen(popen_args, stdin=PIPE, stdout=PIPE, stderr=PIPE) + stdout, stderr = proc.communicate(b'') + proc_out = process_output(stdout, stderr, proc.returncode) + + GlobalConfig.logger.debug('\tprocess_output: {0}'.format(proc_out)) + return proc_out + except Exception as exc: + GlobalConfig.logger.error('\texception: {0}'.format(exc)) + return process_output('', exc.message, -1) + + +def get_dependencies(filename): + """ + input: filename must be an absolute path + Should call `otool` and returns the list of dependencies, unsorted, + unmodified, just the raw list so then we could eventually re-use in other + more specialized functions + """ + GlobalConfig.logger.debug('get_dependencies({0})'.format(filename)) + popen_args = ['otool', '-L', filename] + proc_out = run_and_get_output(popen_args) + deps = [] + if proc_out.retcode == 0: + # some string splitting + deps = [s.strip().split(' ')[0] for s in proc_out.stdout.splitlines()[1:] if s] + # prevent infinite recursion when a binary depends on itself (seen with QtWidgets)... + deps = [s for s in deps if os.path.basename(filename) not in s] + return deps + + +def is_qt_plugin(filename): + """ + Checks if a given file is a qt plugin. + Accepts absolute path as well as path containing @executable_path + """ + qtlib_name_rgx = re.compile(QTPLUGIN_NAME_REGEX) + return qtlib_name_rgx.match(filename) is not None + + +def is_qt_lib(filename): + """ + Checks if a given file is a qt library. + Accepts absolute path as well as path containing @executable_path + """ + qtlib_name_rgx = re.compile(QTLIB_NAME_REGEX) + return qtlib_name_rgx.match(filename) is not None + + +def is_loader_path_lib(filename): + """ + Checks if a given file is loaded via @loader_path or @rpath + """ + qtlib_name_rgx = re.compile(LOADERPATH_REGEX) + return qtlib_name_rgx.match(filename) is not None + + +def normalize_qtplugin_name(filename): + """ + input: a path to a qt plugin, as returned by otool, that can have this form : + - an absolute path /../plugins/PLUGINTYPE/PLUGINNAME.dylib + - @executable_path/../plugins/PLUGINTYPE/PLUGINNAME.dylib + output: + a tuple (qtlib, abspath, rpath) where: + - qtname is the name of the plugin (libqcocoa.dylib, etc.) + - abspath is the absolute path of the qt lib inside the app bundle of exepath + - relpath is the correct rpath to a qt lib inside the app bundle + """ + + GlobalConfig.logger.debug('normalize_plugin_name({0})'.format(filename)) + + qtplugin_name_rgx = re.compile(QTPLUGIN_NAME_REGEX) + rgxret = qtplugin_name_rgx.match(filename) + if not rgxret: + msg = 'couldn\'t normalize a non-qt plugin filename: {0}'.format(filename) + GlobalConfig.logger.critical(msg) + raise Exception(msg) + + # qtplugin normalization settings + qtplugintype = rgxret.groups()[0] + qtpluginname = rgxret.groups()[1] + + templ = Template(QTPLUGIN_NORMALIZED) + + # from qtlib, forge 2 path : + # - absolute path of qt lib in bundle, + abspath = os.path.normpath(templ.safe_substitute( + prefix=os.path.dirname(GlobalConfig.exepath) + '/..', + plugintype=qtplugintype, + pluginname=qtpluginname)) + + # - and rpath containing @executable_path, relative to exepath + rpath = templ.safe_substitute( + prefix='@executable_path/..', + plugintype=qtplugintype, + pluginname=qtpluginname) + + GlobalConfig.logger.debug('\treturns({0})'.format((qtpluginname, abspath, rpath))) + return qtpluginname, abspath, rpath + + +def normalize_qtlib_name(filename): + """ + input: a path to a qt library, as returned by otool, that can have this form : + - an absolute path /lib/xxx/yyy + - @executable_path/../Frameworks/QtSerialPort.framework/Versions/5/QtSerialPort + output: + a tuple (qtlib, abspath, rpath) where: + - qtlib is the name of the qtlib (QtCore, QtWidgets, etc.) + - abspath is the absolute path of the qt lib inside the app bundle of exepath + - relpath is the correct rpath to a qt lib inside the app bundle + """ + GlobalConfig.logger.debug('normalize_qtlib_name({0})'.format(filename)) + + qtlib_name_rgx = re.compile(QTLIB_NAME_REGEX) + rgxret = qtlib_name_rgx.match(filename) + if not rgxret: + msg = 'couldn\'t normalize a non-qt lib filename: {0}'.format(filename) + GlobalConfig.logger.critical(msg) + raise Exception(msg) + + # qtlib normalization settings + qtlib = rgxret.groups()[0] + qtversion = 5 + + templ = Template(QTLIB_NORMALIZED) + + # from qtlib, forge 2 path : + # - absolute path of qt lib in bundle, + abspath = os.path.normpath(templ.safe_substitute( + prefix=os.path.dirname(GlobalConfig.exepath) + '/..', + qtlib=qtlib, + qtversion=qtversion)) + + # - and rpath containing @executable_path, relative to exepath + rpath = templ.safe_substitute( + prefix='@executable_path/..', + qtlib=qtlib, + qtversion=qtversion) + + GlobalConfig.logger.debug('\treturns({0})'.format((qtlib, abspath, rpath))) + return qtlib, abspath, rpath + + +def normalize_loaderpath_name(filename): + """ + input: a path to a loaderpath library, as returned by otool, that can have this form : + - an relative path @loaderpath/yyy + output: + a tuple (loaderpathlib, abspath, rpath) where: + - loaderpathlib is the name of the loaderpath lib + - abspath is the absolute path of the qt lib inside the app bundle of exepath + - relpath is the correct rpath to a qt lib inside the app bundle + """ + GlobalConfig.logger.debug('normalize_loaderpath_name({0})'.format(filename)) + + loaderpath_name_rgx = re.compile(LOADERPATH_REGEX) + rgxret = loaderpath_name_rgx.match(filename) + if not rgxret: + msg = 'couldn\'t normalize a loaderpath lib filename: {0}'.format(filename) + GlobalConfig.logger.critical(msg) + raise Exception(msg) + + # loaderpath normalization settings + loaderpathlib = rgxret.groups()[0] + templ = Template(LOADERPATH_NORMALIZED) + + # from loaderpath, forge 2 path : + # - absolute path of qt lib in bundle, + abspath = os.path.normpath(templ.safe_substitute( + prefix=os.path.dirname(GlobalConfig.exepath) + '/..', + loaderpathlib=loaderpathlib)) + + # - and rpath containing @executable_path, relative to exepath + rpath = templ.safe_substitute( + prefix='@executable_path/..', + loaderpathlib=loaderpathlib) + + GlobalConfig.logger.debug('\treturns({0})'.format((loaderpathlib, abspath, rpath))) + return loaderpathlib, abspath, rpath + + +def fix_dependency(binary, dep): + """ + fix 'dep' dependency of 'binary'. 'dep' is a qt library + """ + if is_qt_lib(dep): + qtname, dep_abspath, dep_rpath = normalize_qtlib_name(dep) + qtnamesrc = os.path.join(GlobalConfig.qtpath, 'lib', '{0}.framework'. + format(qtname), qtname) + elif is_qt_plugin(dep): + qtname, dep_abspath, dep_rpath = normalize_qtplugin_name(dep) + qtnamesrc = os.path.join(GlobalConfig.qtpath, 'lib', '{0}.framework'. + format(qtname), qtname) + elif is_loader_path_lib(dep): + qtname, dep_abspath, dep_rpath = normalize_loaderpath_name(dep) + qtnamesrc = os.path.join(GlobalConfig.qtpath + '/lib', qtname) + else: + return True + + dep_ok = True + # check that rpath of 'dep' inside binary has been correctly set + # (ie: relative to exepath using '@executable_path' syntax) + if dep != dep_rpath: + # dep rpath is not ok + GlobalConfig.logger.info('changing rpath \'{0}\' in binary {1}'.format(dep, binary)) + + # call install_name_tool -change on binary + popen_args = ['install_name_tool', '-change', dep, dep_rpath, binary] + proc_out = run_and_get_output(popen_args) + if proc_out.retcode != 0: + GlobalConfig.logger.error(proc_out.stderr) + dep_ok = False + else: + # call install_name_tool -id on binary + popen_args = ['install_name_tool', '-id', dep_rpath, binary] + proc_out = run_and_get_output(popen_args) + if proc_out.retcode != 0: + GlobalConfig.logger.error(proc_out.stderr) + dep_ok = False + + # now ensure that 'dep' exists at the specified path, relative to bundle + if dep_ok and not os.path.exists(dep_abspath): + + # ensure destination directory exists + GlobalConfig.logger.info('ensuring directory \'{0}\' exists: {0}'. + format(os.path.dirname(dep_abspath))) + popen_args = ['mkdir', '-p', os.path.dirname(dep_abspath)] + proc_out = run_and_get_output(popen_args) + if proc_out.retcode != 0: + GlobalConfig.logger.info(proc_out.stderr) + dep_ok = False + else: + # copy missing dependency into bundle + GlobalConfig.logger.info('copying missing dependency in bundle: {0}'. + format(qtname)) + popen_args = ['cp', qtnamesrc, dep_abspath] + proc_out = run_and_get_output(popen_args) + if proc_out.retcode != 0: + GlobalConfig.logger.info(proc_out.stderr) + dep_ok = False + else: + # ensure permissions are correct if we ever have to change its rpath + GlobalConfig.logger.info('ensuring 755 perm to {0}'.format(dep_abspath)) + popen_args = ['chmod', '755', dep_abspath] + proc_out = run_and_get_output(popen_args) + if proc_out.retcode != 0: + GlobalConfig.logger.info(proc_out.stderr) + dep_ok = False + else: + GlobalConfig.logger.debug('{0} is at correct location in bundle'.format(qtname)) + + if dep_ok: + return fix_binary(dep_abspath) + return False + + +def fix_binary(binary): + """ + input: + binary: relative or absolute path (no @executable_path syntax) + process: + - first fix the rpath for the qt libs on which 'binary' depend + - copy into the bundle of exepath the eventual libraries that are missing + - (create the soft links) needed ? + - do the same for all qt dependencies of binary (recursive) + """ + GlobalConfig.logger.debug('fix_binary({0})'.format(binary)) + + # loop on 'binary' dependencies + for dep in get_dependencies(binary): + if not fix_dependency(binary, dep): + GlobalConfig.logger.error('quitting early: couldn\'t fix dependency {0} of {1}'.format(dep, binary)) + return False + return True + + +def fix_main_binaries(): + """ + list the main binaries of the app bundle and fix them + """ + # deduce bundle path + bundlepath = os.path.sep.join(GlobalConfig.exepath.split(os.path.sep)[0:-3]) + + # fix main binary + GlobalConfig.logger.info('fixing executable \'{0}\''.format(GlobalConfig.exepath)) + if fix_binary(GlobalConfig.exepath): + GlobalConfig.logger.info('fixing plugins') + for root, dummy, files in os.walk(bundlepath): + for name in [f for f in files if os.path.splitext(f)[1] == '.dylib']: + GlobalConfig.logger.info('fixing plugin {0}'.format(name)) + if not fix_binary(os.path.join(root, name)): + return False + return True + + +def main(): + descr = """finish the job started by macdeployqt! + - find dependencies/rpaths with otool + - copy missed dependencies with cp and mkdir + - fix missed rpaths with install_name_tool + + exit codes: + - 0 : success + - 1 : error + """ + + parser = argparse.ArgumentParser(description=descr, + formatter_class=argparse.RawTextHelpFormatter) + parser.add_argument('exepath', + help='path to the binary depending on Qt') + parser.add_argument('qtpath', + help='path of Qt libraries used to build the Qt application') + parser.add_argument('-q', '--quiet', action='store_true', default=False, + help='do not create log on standard output') + parser.add_argument('-nl', '--no-log-file', action='store_true', default=False, + help='do not create log file \'./macdeployqtfix.log\'') + parser.add_argument('-v', '--verbose', action='store_true', default=False, + help='produce more log messages(debug log)') + args = parser.parse_args() + + # globals + GlobalConfig.qtpath = os.path.normpath(args.qtpath) + GlobalConfig.exepath = args.exepath + GlobalConfig.logger = logging.getLogger() + + # configure logging + ################### + + # create formatter + formatter = logging.Formatter('%(levelname)s | %(message)s') + # create console GlobalConfig.logger + if not args.quiet: + chdlr = logging.StreamHandler(sys.stdout) + chdlr.setFormatter(formatter) + GlobalConfig.logger.addHandler(chdlr) + + # create file GlobalConfig.logger + if not args.no_log_file: + fhdlr = logging.FileHandler('./macdeployqtfix.log', mode='w') + fhdlr.setFormatter(formatter) + GlobalConfig.logger.addHandler(fhdlr) + + if args.no_log_file and args.quiet: + GlobalConfig.logger.addHandler(logging.NullHandler()) + else: + GlobalConfig.logger.setLevel(logging.DEBUG if args.verbose else logging.INFO) + + if fix_main_binaries(): + GlobalConfig.logger.info('macdeployqtfix terminated with success') + ret = 0 + else: + GlobalConfig.logger.error('macdeployqtfix terminated with error') + ret = 1 + sys.exit(ret) + + +if __name__ == "__main__": + main()
\ No newline at end of file diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index 10e8bd75e..f657e2710 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -107,7 +107,7 @@ if(NOT EXISTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" AND NOT _CMAKE_I message(WARNING "There are no libraries installed for the Vcpkg triplet ${VCPKG_TARGET_TRIPLET}.") endif() -if(CMAKE_BUILD_TYPE MATCHES "^Debug$" OR NOT DEFINED CMAKE_BUILD_TYPE) #Debug build: Put Debug paths before Release paths. +if(CMAKE_BUILD_TYPE MATCHES "^[Dd][Ee][Bb][Uu][Gg]$" OR NOT DEFINED CMAKE_BUILD_TYPE) #Debug build: Put Debug paths before Release paths. list(APPEND CMAKE_PREFIX_PATH ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET} ) @@ -130,6 +130,8 @@ else() #Release build: Put Release paths before Debug paths. Debug Paths are req endif() file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" _programfiles) +set(_PROGRAMFILESX86 "PROGRAMFILES(x86)") +file(TO_CMAKE_PATH "$ENV{${_PROGRAMFILESX86}}" _programfiles_x86) set(CMAKE_SYSTEM_IGNORE_PATH "${_programfiles}/OpenSSL" "${_programfiles}/OpenSSL-Win32" @@ -138,6 +140,13 @@ set(CMAKE_SYSTEM_IGNORE_PATH "${_programfiles}/OpenSSL-Win64/lib/VC" "${_programfiles}/OpenSSL-Win32/lib/VC/static" "${_programfiles}/OpenSSL-Win64/lib/VC/static" + "${_programfiles_x86}/OpenSSL" + "${_programfiles_x86}/OpenSSL-Win32" + "${_programfiles_x86}/OpenSSL-Win64" + "${_programfiles_x86}/OpenSSL-Win32/lib/VC" + "${_programfiles_x86}/OpenSSL-Win64/lib/VC" + "${_programfiles_x86}/OpenSSL-Win32/lib/VC/static" + "${_programfiles_x86}/OpenSSL-Win64/lib/VC/static" "C:/OpenSSL/" "C:/OpenSSL-Win32/" "C:/OpenSSL-Win64/" @@ -160,14 +169,25 @@ function(add_executable name) _add_executable(${ARGV}) list(FIND ARGV "IMPORTED" IMPORTED_IDX) list(FIND ARGV "ALIAS" ALIAS_IDX) + list(FIND ARGV "MACOSX_BUNDLE" MACOSX_BUNDLE_IDX) if(IMPORTED_IDX EQUAL -1 AND ALIAS_IDX EQUAL -1) - if(VCPKG_APPLOCAL_DEPS AND _VCPKG_TARGET_TRIPLET_PLAT MATCHES "windows|uwp") - add_custom_command(TARGET ${name} POST_BUILD - COMMAND powershell -noprofile -executionpolicy Bypass -file ${_VCPKG_TOOLCHAIN_DIR}/msbuild/applocal.ps1 - -targetBinary $<TARGET_FILE:${name}> - -installedDir "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$<CONFIG:Debug>:/debug>/bin" - -OutVariable out - ) + if(VCPKG_APPLOCAL_DEPS) + if(_VCPKG_TARGET_TRIPLET_PLAT MATCHES "windows|uwp") + add_custom_command(TARGET ${name} POST_BUILD + COMMAND powershell -noprofile -executionpolicy Bypass -file ${_VCPKG_TOOLCHAIN_DIR}/msbuild/applocal.ps1 + -targetBinary $<TARGET_FILE:${name}> + -installedDir "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$<CONFIG:Debug>:/debug>/bin" + -OutVariable out + ) + elseif(_VCPKG_TARGET_TRIPLET_PLAT MATCHES "osx") + if (NOT MACOSX_BUNDLE_IDX EQUAL -1) + add_custom_command(TARGET ${name} POST_BUILD + COMMAND python ${_VCPKG_TOOLCHAIN_DIR}/osx/applocal.py + $<TARGET_FILE:${name}> + "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}$<$<CONFIG:Debug>:/debug>" + ) + endif() + endif() endif() set_target_properties(${name} PROPERTIES VS_USER_PROPS do_not_import_user.props) set_target_properties(${name} PROPERTIES VS_GLOBAL_VcpkgEnabled false) diff --git a/scripts/cmake/vcpkg_acquire_msys.cmake b/scripts/cmake/vcpkg_acquire_msys.cmake index adbd58ca5..09090db68 100644 --- a/scripts/cmake/vcpkg_acquire_msys.cmake +++ b/scripts/cmake/vcpkg_acquire_msys.cmake @@ -113,5 +113,13 @@ function(vcpkg_acquire_msys PATH_TO_ROOT_OUT) message(STATUS "Acquiring MSYS Packages... OK") endif() + # Deal with a stale process created by MSYS + if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + vcpkg_execute_required_process( + COMMAND TASKKILL /F /IM gpg-agent.exe /fi "memusage gt 2" + WORKING_DIRECTORY ${SOURCE_PATH} + ) + endif() + set(${PATH_TO_ROOT_OUT} ${PATH_TO_ROOT} PARENT_SCOPE) endfunction() diff --git a/scripts/cmake/vcpkg_build_cmake.cmake b/scripts/cmake/vcpkg_build_cmake.cmake index e86632c7e..b110d2cc9 100644 --- a/scripts/cmake/vcpkg_build_cmake.cmake +++ b/scripts/cmake/vcpkg_build_cmake.cmake @@ -60,10 +60,6 @@ function(vcpkg_build_cmake) set(TARGET_PARAM) endif() - if(_bc_DISABLE_PARALLEL) - set(PARALLEL_ARG ${NO_PARALLEL_ARG}) - endif() - foreach(BUILDTYPE "debug" "release") if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL BUILDTYPE) if(BUILDTYPE STREQUAL "debug") @@ -75,8 +71,6 @@ function(vcpkg_build_cmake) endif() message(STATUS "Building ${TARGET_TRIPLET}-${SHORT_BUILDTYPE}") - set(LOGPREFIX "${CURRENT_BUILDTREES_DIR}/${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}-${SHORT_BUILDTYPE}") - set(LOGS) if(_bc_ADD_BIN_TO_PATH) set(_BACKUP_ENV_PATH "$ENV{PATH}") @@ -91,121 +85,22 @@ function(vcpkg_build_cmake) set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin${_PATHSEP}$ENV{PATH}") endif() endif() - execute_process( - COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} ${PARALLEL_ARG} - OUTPUT_FILE "${LOGPREFIX}-out.log" - ERROR_FILE "${LOGPREFIX}-err.log" - RESULT_VARIABLE error_code - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_BUILDTYPE}) - if(error_code) - file(READ "${LOGPREFIX}-out.log" out_contents) - file(READ "${LOGPREFIX}-err.log" err_contents) - - if(out_contents) - list(APPEND LOGS "${LOGPREFIX}-out.log") - endif() - if(err_contents) - list(APPEND LOGS "${LOGPREFIX}-err.log") - endif() - - if(out_contents MATCHES "LINK : fatal error LNK1102:" OR out_contents MATCHES " fatal error C1060: ") - # The linker ran out of memory during execution. We will try continuing once more, with parallelism disabled. - message(STATUS "Restarting Build ${TARGET_TRIPLET}-${SHORT_BUILDTYPE} without parallelism because memory exceeded") - execute_process( - COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} ${NO_PARALLEL_ARG} - OUTPUT_FILE "${LOGPREFIX}-out-1.log" - ERROR_FILE "${LOGPREFIX}-err-1.log" - RESULT_VARIABLE error_code - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_BUILDTYPE}) - - if(error_code) - file(READ "${LOGPREFIX}-out-1.log" out_contents) - file(READ "${LOGPREFIX}-err-1.log" err_contents) - - if(out_contents) - list(APPEND LOGS "${LOGPREFIX}-out-1.log") - endif() - if(err_contents) - list(APPEND LOGS "${LOGPREFIX}-err-1.log") - endif() - endif() - elseif(out_contents MATCHES ": No such file or directory") - # WSL workaround - WSL occassionally fails with no such file or directory. Detect if we are running in WSL and restart. - execute_process(COMMAND "uname" "-r" - OUTPUT_VARIABLE UNAME_R ERROR_VARIABLE UNAME_R - OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE) - - if (UNAME_R MATCHES "Microsoft") - set(ITERATION 0) - while (ITERATION LESS 10 AND out_contents MATCHES ": No such file or directory") - MATH(EXPR ITERATION "${ITERATION}+1") - message(STATUS "Restarting Build ${TARGET_TRIPLET}-${SHORT_BUILDTYPE} because of wsl subsystem issue. Iteration: ${ITERATION}") - execute_process( - COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} - OUTPUT_FILE "${LOGPREFIX}-out-${ITERATION}.log" - ERROR_FILE "${LOGPREFIX}-err-${ITERATION}.log" - RESULT_VARIABLE error_code - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_BUILDTYPE}) - if(error_code) - file(READ "${LOGPREFIX}-out-${ITERATION}.log" out_contents) - file(READ "${LOGPREFIX}-err-${ITERATION}.log" err_contents) - - if(out_contents) - list(APPEND LOGS "${LOGPREFIX}-out-${ITERATION}.log") - endif() - if(err_contents) - list(APPEND LOGS "${LOGPREFIX}-err-${ITERATION}.log") - endif() - else() - break() - endif() - endwhile() - endif() - elseif(out_contents MATCHES "mt : general error c101008d: ") - # Antivirus workaround - occasionally files are locked and cause mt.exe to fail - set(ITERATION 0) - while (ITERATION LESS 3 AND out_contents MATCHES "mt : general error c101008d: ") - MATH(EXPR ITERATION "${ITERATION}+1") - message(STATUS "Restarting Build ${TARGET_TRIPLET}-${SHORT_BUILDTYPE} because of mt.exe file locking issue. Iteration: ${ITERATION}") - execute_process( - COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} - OUTPUT_FILE "${LOGPREFIX}-out-${ITERATION}.log" - ERROR_FILE "${LOGPREFIX}-err-${ITERATION}.log" - RESULT_VARIABLE error_code - WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_BUILDTYPE}) - - if(error_code) - file(READ "${LOGPREFIX}-out-${ITERATION}.log" out_contents) - file(READ "${LOGPREFIX}-err-${ITERATION}.log" err_contents) - - if(out_contents) - list(APPEND LOGS "${LOGPREFIX}-out-${ITERATION}.log") - endif() - if(err_contents) - list(APPEND LOGS "${LOGPREFIX}-err-${ITERATION}.log") - endif() - else() - break() - endif() - endwhile() - endif() - - if(error_code) - set(STRINGIFIED_LOGS) - foreach(LOG ${LOGS}) - file(TO_NATIVE_PATH "${LOG}" NATIVE_LOG) - list(APPEND STRINGIFIED_LOGS " ${NATIVE_LOG}\n") - endforeach() - set(_eb_COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} ${PARALLEL_ARG}) - set(_eb_WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_BUILDTYPE}) - message(FATAL_ERROR - " Command failed: ${_eb_COMMAND}\n" - " Working Directory: ${_eb_WORKING_DIRECTORY}\n" - " See logs for more information:\n" - ${STRINGIFIED_LOGS}) - endif() + if (_bc_DISABLE_PARALLEL) + vcpkg_execute_build_process( + COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} ${NO_PARALLEL_ARG} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_BUILDTYPE} + LOGNAME "${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}-${SHORT_BUILDTYPE}" + ) + else() + vcpkg_execute_build_process( + COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} ${PARALLEL_ARG} + NO_PARALLEL_COMMAND ${CMAKE_COMMAND} --build . --config ${CONFIG} ${TARGET_PARAM} -- ${BUILD_ARGS} ${NO_PARALLEL_ARG} + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_BUILDTYPE} + LOGNAME "${_bc_LOGFILE_ROOT}-${TARGET_TRIPLET}-${SHORT_BUILDTYPE}" + ) endif() + if(_bc_ADD_BIN_TO_PATH) set(ENV{PATH} "${_BACKUP_ENV_PATH}") endif() diff --git a/scripts/cmake/vcpkg_build_qmake.cmake b/scripts/cmake/vcpkg_build_qmake.cmake index 80a0aef0d..cf79fe8fc 100644 --- a/scripts/cmake/vcpkg_build_qmake.cmake +++ b/scripts/cmake/vcpkg_build_qmake.cmake @@ -11,9 +11,11 @@ function(vcpkg_build_qmake) cmake_parse_arguments(_csc "SKIP_MAKEFILES" "BUILD_LOGNAME" "TARGETS;RELEASE_TARGETS;DEBUG_TARGETS" ${ARGN}) if(CMAKE_HOST_WIN32) + set(_PATHSEP ";") vcpkg_find_acquire_program(JOM) set(INVOKE "${JOM}") else() + set(_PATHSEP ":") find_program(MAKE make) set(INVOKE "${MAKE}") endif() @@ -56,7 +58,7 @@ function(vcpkg_build_qmake) #First generate the makefiles so we can modify them if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/debug/lib;${CURRENT_INSTALLED_DIR}/debug/bin;${CURRENT_INSTALLED_DIR}/tools/qt5;${ENV_PATH_BACKUP}") + set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/debug/lib${_PATHSEP}${CURRENT_INSTALLED_DIR}/debug/bin${_PATHSEP}${CURRENT_INSTALLED_DIR}/tools/qt5${_PATHSEP}${ENV_PATH_BACKUP}") if(NOT _csc_SKIP_MAKEFILES) run_jom(qmake_all makefiles dbg) @@ -81,7 +83,7 @@ function(vcpkg_build_qmake) endif() if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/lib;${CURRENT_INSTALLED_DIR}/bin;${CURRENT_INSTALLED_DIR}/tools/qt5;${ENV_PATH_BACKUP}") + set(ENV{PATH} "${CURRENT_INSTALLED_DIR}/lib${_PATHSEP}${CURRENT_INSTALLED_DIR}/bin${_PATHSEP}${CURRENT_INSTALLED_DIR}/tools/qt5${_PATHSEP}${ENV_PATH_BACKUP}") if(NOT _csc_SKIP_MAKEFILES) run_jom(qmake_all makefiles rel) diff --git a/scripts/cmake/vcpkg_common_functions.cmake b/scripts/cmake/vcpkg_common_functions.cmake index d66fc5eff..b99f8bee8 100644 --- a/scripts/cmake/vcpkg_common_functions.cmake +++ b/scripts/cmake/vcpkg_common_functions.cmake @@ -7,6 +7,7 @@ include(vcpkg_extract_source_archive) include(vcpkg_extract_source_archive_ex) include(vcpkg_execute_required_process) include(vcpkg_execute_required_process_repeat) +include(vcpkg_execute_build_process) include(vcpkg_find_acquire_program) include(vcpkg_fixup_cmake_targets) include(vcpkg_from_github) diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake index ceff199ab..8f3aa6425 100644 --- a/scripts/cmake/vcpkg_configure_cmake.cmake +++ b/scripts/cmake/vcpkg_configure_cmake.cmake @@ -207,6 +207,7 @@ function(vcpkg_configure_cmake) "-DVCPKG_C_FLAGS_DEBUG=${VCPKG_C_FLAGS_DEBUG}" "-DVCPKG_CRT_LINKAGE=${VCPKG_CRT_LINKAGE}" "-DVCPKG_LINKER_FLAGS=${VCPKG_LINKER_FLAGS}" + "-DVCPKG_TARGET_ARCHITECTURE=${VCPKG_TARGET_ARCHITECTURE}" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" ) diff --git a/scripts/cmake/vcpkg_configure_meson.cmake b/scripts/cmake/vcpkg_configure_meson.cmake index 3c6903c9d..f1ae0e65f 100644 --- a/scripts/cmake/vcpkg_configure_meson.cmake +++ b/scripts/cmake/vcpkg_configure_meson.cmake @@ -26,7 +26,7 @@ function(vcpkg_configure_meson) set(MESON_RELEASE_LDFLAGS "${MESON_RELEASE_LDFLAGS} /INCREMENTAL:NO /OPT:REF /OPT:ICF") # select meson cmd-line options - list(APPEND _vcm_OPTIONS --buildtype plain --backend ninja) + list(APPEND _vcm_OPTIONS --buildtype plain --backend ninja --wrap-mode nodownload) if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) list(APPEND _vcm_OPTIONS --default-library shared) else() diff --git a/scripts/cmake/vcpkg_execute_build_process.cmake b/scripts/cmake/vcpkg_execute_build_process.cmake new file mode 100644 index 000000000..d440ba2f6 --- /dev/null +++ b/scripts/cmake/vcpkg_execute_build_process.cmake @@ -0,0 +1,141 @@ +## # vcpkg_execute_build_process +## +## Execute a required build process +## +## ## Usage +## ```cmake +## vcpkg_execute_build_process( +## COMMAND <cmd> [<args>...] +## [NO_PARALLEL_COMMAND <cmd> [<args>...]] +## WORKING_DIRECTORY </path/to/dir> +## LOGNAME <log_name>) +## ) +## ``` +## ## Parameters +## ### COMMAND +## The command to be executed, along with its arguments. +## +## ### NO_PARALLEL_COMMAND +## Optional parameter which specifies a non-parallel command to attempt if a +## failure potentially due to parallelism is detected. +## +## ### WORKING_DIRECTORY +## The directory to execute the command in. +## +## ### LOGNAME +## The prefix to use for the log files. +## +## This should be a unique name for different triplets so that the logs don't +## conflict when building multiple at once. +## +## ## Examples +## +## * [icu](https://github.com/Microsoft/vcpkg/blob/master/ports/icu/portfile.cmake) +function(vcpkg_execute_build_process) + cmake_parse_arguments(_ebp "" "WORKING_DIRECTORY;LOGNAME" "COMMAND;NO_PARALLEL_COMMAND" ${ARGN}) + + set(LOG_OUT "${CURRENT_BUILDTREES_DIR}/${_ebp_LOGNAME}-out.log") + set(LOG_ERR "${CURRENT_BUILDTREES_DIR}/${_ebp_LOGNAME}-err.log") + + execute_process( + COMMAND ${_ebp_COMMAND} + WORKING_DIRECTORY ${_ebp_WORKING_DIRECTORY} + OUTPUT_FILE ${LOG_OUT} + ERROR_FILE ${LOG_ERR} + RESULT_VARIABLE error_code + ) + + if(error_code) + file(READ ${LOG_OUT} out_contents) + file(READ ${LOG_ERR} err_contents) + + if(out_contents) + list(APPEND LOGS ${LOG_OUT}) + endif() + if(err_contents) + list(APPEND LOGS ${LOG_ERR}) + endif() + + if(out_contents MATCHES "LINK : fatal error LNK1102:" OR out_contents MATCHES " fatal error C1060: " + OR err_contents MATCHES "LINK : fatal error LNK1102:" OR err_contents MATCHES " fatal error C1060: " + OR out_contents MATCHES "LINK : fatal error LNK1318: Unexpected PDB error; ACCESS_DENIED" + OR out_contents MATCHES "LINK : fatal error LNK1104:" + OR out_contents MATCHES "LINK : fatal error LNK1201:") + # The linker ran out of memory during execution. We will try continuing once more, with parallelism disabled. + message(STATUS "Restarting Build without parallelism because memory exceeded") + set(LOG_OUT "${CURRENT_BUILDTREES_DIR}/${_ebp_LOGNAME}-out-1.log") + set(LOG_ERR "${CURRENT_BUILDTREES_DIR}/${_ebp_LOGNAME}-err-1.log") + + if(_ebp_NO_PARALLEL_COMMAND) + execute_process( + COMMAND ${_ebp_NO_PARALLEL_COMMAND} + WORKING_DIRECTORY ${_ebp_WORKING_DIRECTORY} + OUTPUT_FILE ${LOG_OUT} + ERROR_FILE ${LOG_ERR} + RESULT_VARIABLE error_code + ) + else() + execute_process( + COMMAND ${_ebp_COMMAND} + WORKING_DIRECTORY ${_ebp_WORKING_DIRECTORY} + OUTPUT_FILE ${LOG_OUT} + ERROR_FILE ${LOG_ERR} + RESULT_VARIABLE error_code + ) + endif() + + if(error_code) + file(READ ${LOG_OUT} out_contents) + file(READ ${LOG_ERR} err_contents) + + if(out_contents) + list(APPEND LOGS ${LOG_OUT}) + endif() + if(err_contents) + list(APPEND LOGS ${LOG_ERR}) + endif() + endif() + elseif(out_contents MATCHES "mt : general error c101008d: " OR out_contents MATCHES "mt.exe : general error c101008d: ") + # Antivirus workaround - occasionally files are locked and cause mt.exe to fail + message(STATUS "mt.exe has failed. This may be the result of anti-virus. Disabling anti-virus on the buildtree folder may improve build speed") + set(ITERATION 0) + while (ITERATION LESS 3 AND (out_contents MATCHES "mt : general error c101008d: " OR out_contents MATCHES "mt.exe : general error c101008d: ")) + MATH(EXPR ITERATION "${ITERATION}+1") + message(STATUS "Restarting Build ${TARGET_TRIPLET}-${SHORT_BUILDTYPE} because of mt.exe file locking issue. Iteration: ${ITERATION}") + execute_process( + COMMAND ${_ebp_COMMAND} + OUTPUT_FILE "${LOGPREFIX}-out-${ITERATION}.log" + ERROR_FILE "${LOGPREFIX}-err-${ITERATION}.log" + RESULT_VARIABLE error_code + WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${SHORT_BUILDTYPE}) + + if(error_code) + file(READ "${LOGPREFIX}-out-${ITERATION}.log" out_contents) + file(READ "${LOGPREFIX}-err-${ITERATION}.log" err_contents) + + if(out_contents) + list(APPEND LOGS "${LOGPREFIX}-out-${ITERATION}.log") + endif() + if(err_contents) + list(APPEND LOGS "${LOGPREFIX}-err-${ITERATION}.log") + endif() + else() + break() + endif() + endwhile() + endif() + + if(error_code) + set(STRINGIFIED_LOGS) + foreach(LOG ${LOGS}) + file(TO_NATIVE_PATH "${LOG}" NATIVE_LOG) + list(APPEND STRINGIFIED_LOGS " ${NATIVE_LOG}\n") + endforeach() + message(FATAL_ERROR + " Command failed: ${_ebp_COMMAND}\n" + " Working Directory: ${_ebp_WORKING_DIRECTORY}\n" + " See logs for more information:\n" + ${STRINGIFIED_LOGS}) + endif(error_code) + endif(error_code) +endfunction(vcpkg_execute_build_process) diff --git a/scripts/cmake/vcpkg_find_acquire_program.cmake b/scripts/cmake/vcpkg_find_acquire_program.cmake index d5e95eb4b..451f4bcd3 100644 --- a/scripts/cmake/vcpkg_find_acquire_program.cmake +++ b/scripts/cmake/vcpkg_find_acquire_program.cmake @@ -79,9 +79,9 @@ function(vcpkg_find_acquire_program VAR) set(PROGNAME python) set(SUBDIR "python3") set(PATHS ${DOWNLOADS}/tools/python/${SUBDIR}) - set(URL "https://www.python.org/ftp/python/3.5.4/python-3.5.4-embed-win32.zip") - set(ARCHIVE "python-3.5.4-embed-win32.zip") - set(HASH b5240fdc95088c2d7f65d2dd598650f8dd106b49589d94156bd4a078b108c6cabbe7a38ef73e2b2cf00e8312a93d2e587eac2c54ce85540d3c7a26cc60013156) + set(URL "https://www.python.org/ftp/python/3.7.3/python-3.7.3-embed-win32.zip") + set(ARCHIVE "python-3.7.3-embed-win32.zip") + set(HASH 2c1b1f0a29d40a91771ae21a5f733eedc10984cd182cb10c2793bbd24191a89f20612a3f23c34047f37fb06369016bfd4a52915ed1b4a56f8bd2b4ca6994eb31) else() set(PROGNAME python3) set(BREW_PACKAGE_NAME "python") @@ -202,9 +202,9 @@ function(vcpkg_find_acquire_program VAR) set(REQUIRED_INTERPRETER PERL) set(SCRIPTNAME "gas-preprocessor.pl") set(PATHS ${DOWNLOADS}/tools/gas-preprocessor) - set(URL "https://raw.githubusercontent.com/FFmpeg/gas-preprocessor/36bacb4cba27003c572e5bf7a9c4dfe3c9a8d40d/gas-preprocessor.pl") + set(URL "https://raw.githubusercontent.com/FFmpeg/gas-preprocessor/cbe88474ec196370161032a3863ec65050f70ba4/gas-preprocessor.pl") set(ARCHIVE "gas-preprocessor.pl") - set(HASH a25caadccd1457a0fd2abb5a0da9aca1713b2c351d76daf87a4141e52021f51aa09e95a62942c6f0764f79cc1fa65bf71584955b09e62ee7da067b5c82baf6b3) + set(HASH f6965875608bf2a3ee337e00c3f16e06cd9b5d10013da600d2a70887e47a7b4668af87b3524acf73dd122475712af831495a613a2128c1adb5fe0b4a11d96cd3) elseif(VAR MATCHES "DARK") set(PROGNAME dark) set(SUBDIR "wix311-binaries") @@ -223,9 +223,9 @@ function(vcpkg_find_acquire_program VAR) elseif(VAR MATCHES "DOXYGEN") set(PROGNAME doxygen) set(PATHS ${DOWNLOADS}/tools/doxygen) - set(URL "http://ftp.stack.nl/pub/users/dimitri/doxygen-1.8.14.windows.bin.zip") - set(ARCHIVE "doxygen-1.8.14.windows.bin.zip") - set(HASH d0d706501e7112045b1f401f22d12a2c8d9b7728edee9ad1975a17dff914c16494ae48a70beab6f6304643779935843f268c7afed3b9da7d403b5cb11cac0c50) + set(URL "http://doxygen.nl/files/doxygen-1.8.15.windows.bin.zip") + set(ARCHIVE "doxygen-1.8.15.windows.bin.zip") + set(HASH 89482dcb1863d381d47812c985593e736d703931d49994e09c7c03ef67e064115d0222b8de1563a7930404c9bc2d3be323f3d13a01ef18861be584db3d5a953c) # Download Tools elseif(VAR MATCHES "ARIA2") set(PROGNAME aria2c) diff --git a/scripts/cmake/vcpkg_from_github.cmake b/scripts/cmake/vcpkg_from_github.cmake index 48bfd828a..c0d657bbc 100644 --- a/scripts/cmake/vcpkg_from_github.cmake +++ b/scripts/cmake/vcpkg_from_github.cmake @@ -161,7 +161,7 @@ function(vcpkg_from_github) # Parse the github refs response with regex. # TODO: use some JSON swiss-army-knife utility instead. - file(READ "${ARCHIVE_VERSION}" _contents) + file(READ "${downloaded_file_path}.version" _contents) string(REGEX MATCH "\"sha\": \"[a-f0-9]+\"" x "${_contents}") string(REGEX REPLACE "\"sha\": \"([a-f0-9]+)\"" "\\1" _version ${x}) diff --git a/scripts/toolchains/linux.cmake b/scripts/toolchains/linux.cmake index b9cbc0ff3..70f224da9 100644 --- a/scripts/toolchains/linux.cmake +++ b/scripts/toolchains/linux.cmake @@ -4,6 +4,9 @@ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") set(CMAKE_CROSSCOMPILING OFF CACHE BOOL "")
endif()
set(CMAKE_SYSTEM_NAME Linux CACHE STRING "")
+if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
+ set(CMAKE_SYSTEM_PROCESSOR x86_64 CACHE STRING "")
+endif()
get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE )
if(NOT _CMAKE_IN_TRY_COMPILE)
|
