mirror of
git://code.qt.io/qt/qt5.git
synced 2026-02-01 19:36:04 +08:00
Enable MySQL for Windows
Pick-to: 6.2 Task-number: QTQAINFRA-4999 Change-Id: Id967473858673253f536cb91f9a95d9d6a3d7f27 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
This commit is contained in:
@@ -80,7 +80,7 @@ Configurations:
|
||||
Features: ['Sccache', "DebugAndRelease", 'UseConfigure']
|
||||
Configure arguments: '-debug-and-release -force-debug-info -headersclean -nomake examples -qt-zlib'
|
||||
Environment variables: [
|
||||
'CMAKE_ARGS=-DFEATURE_msvc_obj_debug_info=ON -DOPENSSL_ROOT_DIR={{.Env.OPENSSL_INCLUDE_x64}}\.. -DPostgreSQL_ROOT={{.Env.POSTGRESQL_LIB_x64}}\..',
|
||||
'CMAKE_ARGS=-DFEATURE_msvc_obj_debug_info=ON -DOPENSSL_ROOT_DIR={{.Env.OPENSSL_INCLUDE_x64}}\.. -DPostgreSQL_ROOT={{.Env.POSTGRESQL_LIB_x64}}\.. -DMySQL_ROOT={{.Env.ENV_MySQL_ROOT}} -DMySQL_LIBRARY_DIR={{.Env.ENV_MySQL_LIBRARY_DIR}}',
|
||||
'NON_QTBASE_CMAKE_ARGS=-DFFMPEG_DIR={{.Env.FFMPEG_DIR_MSVC}}',
|
||||
'LLVM_INSTALL_DIR={{.Env.LLVM_INSTALL_DIR_msvc}}',
|
||||
'Protobuf_ROOT={{.Env.Protobuf_ROOT_msvc}}',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#############################################################################
|
||||
##
|
||||
## Copyright (C) 2019 The Qt Company Ltd.
|
||||
## Copyright (C) 2023 The Qt Company Ltd.
|
||||
## Contact: https://www.qt.io/licensing/
|
||||
##
|
||||
## This file is part of the provisioning scripts of the Qt Toolkit.
|
||||
@@ -42,48 +42,37 @@
|
||||
# This script installs MySQL $version.
|
||||
# Both x86 and x64 versions needed when x86 integrations are done on x64 machine
|
||||
|
||||
$version = "5.7.25"
|
||||
$baseNameX64 = "mysql-$version-winx64"
|
||||
$packagex64 = "C:\Windows\temp\$baseNameX64.zip"
|
||||
$baseNameX86 = "mysql-$version-win32"
|
||||
$packagex86 = "C:\Windows\temp\$baseNameX86.zip"
|
||||
$installFolder = "C:\Utils\my_sql"
|
||||
$version = "6.1.11"
|
||||
$installFolder = "C:\Utils"
|
||||
$officialUrl = "https://downloads.mysql.com/archives/get/p/19/file/mysql-connector-c-${version}-winx64.zip"
|
||||
$officialUrlDebug = "https://downloads.mysql.com/archives/get/p/19/file/mysql-connector-${version}-winx64-debug.zip"
|
||||
$cacheURl = "http://ci-files01-hki.ci.qt.io/input/windows/mysql-connector-c-${version}-winx64.zip"
|
||||
$cacheURlDebug = "http://ci-files01-hki.ci.qt.io/input/windows/mysql-connector-c-${version}-winx64-debug.zip"
|
||||
$sha = "93e22a1ba3944a6c8e01d3ea04c1bfb005b238f9"
|
||||
$shaDebug = "d54088a9182e2f03b4d6f44c327e341eeab16367"
|
||||
$zip = Get-DownloadLocation ("mysql-connector-c-" + $version + "-winx64.zip")
|
||||
$zipDebug = Get-DownloadLocation ("mysql-connector-c-" + $version + "-winx64-debug.zip")
|
||||
|
||||
function DownloadAndInstall
|
||||
{
|
||||
Param (
|
||||
[string]$internalUrl,
|
||||
[string]$package,
|
||||
[string]$installPath
|
||||
function Install {
|
||||
param(
|
||||
[string]$officialUrl,
|
||||
[string]$cacheUrl,
|
||||
[string]$zip,
|
||||
[string]$sha
|
||||
)
|
||||
|
||||
Write-Host "Fetching from URL ..."
|
||||
Copy-Item $internalUrl $package
|
||||
|
||||
$zipDir = [io.path]::GetFileNameWithoutExtension($package)
|
||||
Extract-7Zip $package $installPath "$zipDir\lib $zipDir\bin $zipDir\share $zipDir\include"
|
||||
|
||||
Remove "$package"
|
||||
Download $officialUrl $cacheURl $zip
|
||||
Verify-Checksum $zip $sha
|
||||
Extract-7Zip $zip $installFolder
|
||||
Remove $zip
|
||||
}
|
||||
|
||||
if (Is64BitWinHost) {
|
||||
# Install x64 bit version
|
||||
$architecture = "x64"
|
||||
$internalUrl = "\\ci-files01-hki.intra.qt.io\provisioning\windows\mysql-$version-winx64.zip"
|
||||
Install $officialUrl $cacheURl $zip $sha
|
||||
Install $officialUrlDebug $cacheURlDebug $zipDebug $shaDebug
|
||||
|
||||
DownloadAndInstall $internalUrl $packagex64 $installFolder
|
||||
# Can't set MySQL_ROOT & MySQL_LIBRARY_DIR variables. Those will enable mysql in every windows target.
|
||||
# Let's use ENV_MySQL_* and use it in platform_configs
|
||||
Set-EnvironmentVariable "ENV_MySQL_ROOT" "${installFolder}\mysql-connector-c-${version}-winx64"
|
||||
Set-EnvironmentVariable "ENV_MySQL_LIBRARY_DIR" "${installFolder}\mysql-connector-c-${version}-winx64\lib\vs14"
|
||||
|
||||
Set-EnvironmentVariable "MYSQL_INCLUDE_x64" "$installFolder\$baseNameX64\include"
|
||||
Set-EnvironmentVariable "MYSQL_LIB_x64" "$installFolder\$baseNameX64\lib"
|
||||
}
|
||||
|
||||
# Install x86 bit version
|
||||
$architecture = "x86"
|
||||
$internalUrl = "\\ci-files01-hki.intra.qt.io\provisioning\windows\mysql-$version-win32.zip"
|
||||
DownloadAndInstall $internalUrl $packagex86 $installFolder
|
||||
|
||||
Set-EnvironmentVariable "MYSQL_INCLUDE_x86" "$installFolder\$baseNameX86\include"
|
||||
Set-EnvironmentVariable "MYSQL_LIB_x86" "$installFolder\$baseNameX86\lib"
|
||||
|
||||
# Store version information to ~/versions.txt, which is used to print version information to provision log.
|
||||
Write-Output "MySQL = $version" >> ~/versions.txt
|
||||
|
||||
Reference in New Issue
Block a user