mirror of https://github.com/qt/qt5.git
Update provisioning script to build FFmpeg for Windows ARM64
Fixes: QTBUG-122745 Pick-to: 6.7 6.5 Change-Id: Ib03484ac89f07d7ad6433b0035769f4a9363495b Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
This commit is contained in:
parent
8fae627f8b
commit
befe4a61d6
|
@ -129,7 +129,7 @@ Configurations:
|
||||||
Environment variables: [
|
Environment variables: [
|
||||||
'TARGET_CONFIGURE_ARGS=-debug-and-release -force-debug-info -platform win32-arm64-msvc',
|
'TARGET_CONFIGURE_ARGS=-debug-and-release -force-debug-info -platform win32-arm64-msvc',
|
||||||
'TARGET_CMAKE_ARGS=-DFEATURE_msvc_obj_debug_info=ON -DOPENSSL_ROOT_DIR={{.Env.OPENSSL_ROOT_DIR_x64_arm64}}',
|
'TARGET_CMAKE_ARGS=-DFEATURE_msvc_obj_debug_info=ON -DOPENSSL_ROOT_DIR={{.Env.OPENSSL_ROOT_DIR_x64_arm64}}',
|
||||||
'NON_QTBASE_TARGET_CMAKE_ARGS=-DFEATURE_native_grpc=OFF',
|
'NON_QTBASE_TARGET_CMAKE_ARGS=-DFEATURE_native_grpc=OFF -DFFMPEG_DIR={{.Env.FFMPEG_DIR_MSVC_ARM64}} -DQT_DEPLOY_FFMPEG=TRUE',
|
||||||
'OPENSSL_CONF_x64={{.Env.OPENSSL_CONF_x64_arm64}}',
|
'OPENSSL_CONF_x64={{.Env.OPENSSL_CONF_x64_arm64}}',
|
||||||
'OPENSSL_INCLUDE_x64={{.Env.OPENSSL_INCLUDE_x64_arm64}}',
|
'OPENSSL_INCLUDE_x64={{.Env.OPENSSL_INCLUDE_x64_arm64}}',
|
||||||
'OPENSSL_LIB_x64={{.Env.OPENSSL_LIB_x64_arm64}}',
|
'OPENSSL_LIB_x64={{.Env.OPENSSL_LIB_x64_arm64}}',
|
||||||
|
@ -157,7 +157,7 @@ Configurations:
|
||||||
Environment variables: [
|
Environment variables: [
|
||||||
'TARGET_CONFIGURE_ARGS=-debug-and-release -force-debug-info -platform win32-arm64-msvc',
|
'TARGET_CONFIGURE_ARGS=-debug-and-release -force-debug-info -platform win32-arm64-msvc',
|
||||||
'TARGET_CMAKE_ARGS=-DFEATURE_msvc_obj_debug_info=ON',
|
'TARGET_CMAKE_ARGS=-DFEATURE_msvc_obj_debug_info=ON',
|
||||||
'NON_QTBASE_TARGET_CMAKE_ARGS=-DFEATURE_native_grpc=OFF',
|
'NON_QTBASE_TARGET_CMAKE_ARGS=-DFEATURE_native_grpc=OFF -DFFMPEG_DIR={{.Env.FFMPEG_DIR_MSVC_ARM64}} -DQT_DEPLOY_FFMPEG=TRUE',
|
||||||
'Protobuf_ROOT={{.Env.Protobuf_ROOT_msvc}}',
|
'Protobuf_ROOT={{.Env.Protobuf_ROOT_msvc}}',
|
||||||
]
|
]
|
||||||
-
|
-
|
||||||
|
|
|
@ -307,10 +307,10 @@ function GetVSPath {
|
||||||
}
|
}
|
||||||
|
|
||||||
function EnterVSDevShell {
|
function EnterVSDevShell {
|
||||||
# Add cl to path if it is not already there.
|
Param (
|
||||||
if (Get-Command cl.exe -ErrorAction SilentlyContinue) {
|
[string]$HostArch = "amd64",
|
||||||
return $true
|
[string]$Arch = "amd64"
|
||||||
}
|
)
|
||||||
|
|
||||||
$vsWere = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
|
$vsWere = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
|
||||||
$vcComponent = "Microsoft.VisualStudio.Component.VC.CoreIde"
|
$vcComponent = "Microsoft.VisualStudio.Component.VC.CoreIde"
|
||||||
|
@ -318,10 +318,10 @@ function EnterVSDevShell {
|
||||||
# If MSVC has an ABI break this will stop working, and yet another build must be added.
|
# If MSVC has an ABI break this will stop working, and yet another build must be added.
|
||||||
$VSPath = (& $vsWere -nologo -products * -requires $vcComponent -sort -format value -property installationPath | Select-Object -Last 1)
|
$VSPath = (& $vsWere -nologo -products * -requires $vcComponent -sort -format value -property installationPath | Select-Object -Last 1)
|
||||||
|
|
||||||
Write-Host "Enter VisualStudio developer shell"
|
Write-Host "Enter VisualStudio developer shell (-host_arch=$HostArch -arch=$Arch)"
|
||||||
try {
|
try {
|
||||||
Import-Module "$VSPath\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
|
Import-Module "$VSPath\Common7\Tools\Microsoft.VisualStudio.DevShell.dll"
|
||||||
Enter-VsDevShell -VsInstallPath $VSPath -DevCmdArguments "-arch=x64 -no_logo"
|
Enter-VsDevShell -VsInstallPath $VSPath -DevCmdArguments "-host_arch=$HostArch -arch=$Arch -no_logo"
|
||||||
} catch {
|
} catch {
|
||||||
Write-Host "Failed to enter VisualStudio DevShell"
|
Write-Host "Failed to enter VisualStudio DevShell"
|
||||||
return $false
|
return $false
|
||||||
|
|
|
@ -73,12 +73,29 @@ function InstallMingwFfmpeg {
|
||||||
|
|
||||||
|
|
||||||
function InstallMsvcFfmpeg {
|
function InstallMsvcFfmpeg {
|
||||||
$result = EnterVSDevShell
|
Param (
|
||||||
|
[bool]$isArm64
|
||||||
|
)
|
||||||
|
|
||||||
|
$arch = "amd64"
|
||||||
|
$buildSystem = "msvc"
|
||||||
|
$ffmpegDirEnvVar = "FFMPEG_DIR_MSVC"
|
||||||
|
|
||||||
|
$config = Get-Content "$PSScriptRoot\..\shared\ffmpeg_config_options.txt"
|
||||||
|
|
||||||
|
if ($isArm64) {
|
||||||
|
$arch = "arm64"
|
||||||
|
$buildSystem += "-arm64"
|
||||||
|
$ffmpegDirEnvVar += "_ARM64"
|
||||||
|
$config += " --enable-cross-compile --arch=arm64 --disable-asm"
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = EnterVSDevShell -Arch $arch
|
||||||
if (-Not $result) {
|
if (-Not $result) {
|
||||||
return $false
|
return $false
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = InstallFfmpeg -buildSystem "msvc" -msystem "MSYS" -toolchain "msvc" -ffmpegDirEnvVar "FFMPEG_DIR_MSVC" -shared $true
|
$result = InstallFfmpeg -buildSystem $buildSystem -msystem "MSYS" -toolchain "msvc" -ffmpegDirEnvVar $ffmpegDirEnvVar -shared $true
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
# As ffmpeg build system creates lib*.a file we have to rename them to *.lib files to be recognized by WIN32
|
# As ffmpeg build system creates lib*.a file we have to rename them to *.lib files to be recognized by WIN32
|
||||||
|
@ -138,14 +155,16 @@ function InstallAndroidArmv7 {
|
||||||
}
|
}
|
||||||
|
|
||||||
$mingwRes = InstallMingwFfmpeg
|
$mingwRes = InstallMingwFfmpeg
|
||||||
$msvcRes = InstallMsvcFfmpeg
|
|
||||||
$llvmMingwRes = InstallLlvmMingwFfmpeg
|
$llvmMingwRes = InstallLlvmMingwFfmpeg
|
||||||
$androidArmV7Res = InstallAndroidArmv7
|
$androidArmV7Res = InstallAndroidArmv7
|
||||||
|
$msvcRes = InstallMsvcFfmpeg -isArm64 $false
|
||||||
|
$msvcArm64Res = InstallMsvcFfmpeg -isArm64 $true
|
||||||
|
|
||||||
Write-Host "Ffmpeg installation results:"
|
Write-Host "Ffmpeg installation results:"
|
||||||
Write-Host " mingw:" $(if ($mingwRes) { "OK" } else { "FAIL" })
|
Write-Host " mingw:" $(if ($mingwRes) { "OK" } else { "FAIL" })
|
||||||
Write-Host " msvc:" $(if ($msvcRes) { "OK" } else { "FAIL" })
|
Write-Host " msvc:" $(if ($msvcRes) { "OK" } else { "FAIL" })
|
||||||
|
Write-Host " msvc-arm64:" $(if ($msvcArm64Res) { "OK" } else { "FAIL" })
|
||||||
Write-Host " llvm-mingw:" $(if ($llvmMingwRes) { "OK" } else { "FAIL" })
|
Write-Host " llvm-mingw:" $(if ($llvmMingwRes) { "OK" } else { "FAIL" })
|
||||||
Write-Host " android-armv7:" $(if ($androidArmV7Res) { "OK" } else { "FAIL" })
|
Write-Host " android-armv7:" $(if ($androidArmV7Res) { "OK" } else { "FAIL" })
|
||||||
|
|
||||||
exit $(if ($mingwRes -and $msvcRes -and $llvmMingwRes -and $androidArmV7Res) { 0 } else { 1 })
|
exit $(if ($mingwRes -and $msvcRes -and $msvcArm64Res -and $llvmMingwRes -and $androidArmV7Res) { 0 } else { 1 })
|
||||||
|
|
Loading…
Reference in New Issue