mirror of
git://code.qt.io/qt/qt5.git
synced 2026-03-18 02:06:20 +08:00
Provisioning: Build FFmpeg for Windows ARM64 in ARM64 host
Install msys2 and FFmpeg for QtMultimedia plugin
Task-number: QTBUG-124399
Pick-to: 6.7
Change-Id: Ied2bc1039d9571611666530850c525c35c170c69
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
Reviewed-by: Tero Heikkinen <tero.heikkinen@qt.io>
(cherry picked from commit 88ce036073)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
committed by
Qt Cherry-pick Bot
parent
a24acb5375
commit
e4defad5e2
@@ -160,7 +160,7 @@ Configurations:
|
||||
Configure arguments: '-debug-and-release -force-debug-info -headersclean -nomake examples -qt-zlib -no-sql-psql -no-opengl'
|
||||
Environment variables: [
|
||||
'CMAKE_ARGS=-DFEATURE_msvc_obj_debug_info=ON -DOPENSSL_ROOT_DIR={{.Env.OPENSSL_INCLUDE_arm64}}\..',
|
||||
'NON_QTBASE_CMAKE_ARGS= -DFEATURE_clangcpp=OFF -DFEATURE_qdoc=OFF',
|
||||
'NON_QTBASE_CMAKE_ARGS= -DFEATURE_clangcpp=OFF -DFEATURE_qdoc=OFF -DFFMPEG_DIR={{.Env.FFMPEG_DIR_MSVC_ARM64}} -DQT_DEPLOY_FFMPEG=TRUE',
|
||||
'Protobuf_ROOT={{.Env.Protobuf_ROOT_msvc}}',
|
||||
]
|
||||
-
|
||||
|
||||
@@ -85,6 +85,7 @@ function InstallMingwFfmpeg {
|
||||
|
||||
function InstallMsvcFfmpeg {
|
||||
Param (
|
||||
[string]$hostArch,
|
||||
[bool]$isArm64
|
||||
)
|
||||
|
||||
@@ -98,10 +99,13 @@ function InstallMsvcFfmpeg {
|
||||
$arch = "arm64"
|
||||
$buildSystem += "-arm64"
|
||||
$ffmpegDirEnvVar += "_ARM64"
|
||||
$config += " --enable-cross-compile --arch=arm64 --disable-asm"
|
||||
$config += " --arch=arm64 --disable-asm"
|
||||
if ($hostArch -eq "amd64") {
|
||||
$config += " --enable-cross-compile"
|
||||
}
|
||||
}
|
||||
|
||||
$result = EnterVSDevShell -Arch $arch
|
||||
$result = EnterVSDevShell -HostArch $hostArch -Arch $arch
|
||||
if (-Not $result) {
|
||||
return $false
|
||||
}
|
||||
@@ -112,7 +116,7 @@ function InstallMsvcFfmpeg {
|
||||
# As ffmpeg build system creates lib*.a file we have to rename them to *.lib files to be recognized by WIN32
|
||||
Write-Host "Rename libraries lib*.a -> *.lib"
|
||||
try {
|
||||
$msvcDir = [System.Environment]::GetEnvironmentVariable("FFMPEG_DIR_MSVC", [System.EnvironmentVariableTarget]::Machine)
|
||||
$msvcDir = [System.Environment]::GetEnvironmentVariable($ffmpegDirEnvVar, [System.EnvironmentVariableTarget]::Machine)
|
||||
Get-ChildItem "$msvcDir\lib\lib*.a" | ForEach-Object {
|
||||
$NewName = $_.Name -replace 'lib(\w+).a$', '$1.lib'
|
||||
$Destination = Join-Path -Path $_.Directory.FullName -ChildPath $NewName
|
||||
@@ -201,17 +205,45 @@ function InstallAndroidArmv7 {
|
||||
return $result
|
||||
}
|
||||
|
||||
$mingwRes = InstallMingwFfmpeg
|
||||
$llvmMingwRes = InstallLlvmMingwFfmpeg
|
||||
$androidArmV7Res = InstallAndroidArmv7
|
||||
$msvcRes = InstallMsvcFfmpeg -isArm64 $false
|
||||
$msvcArm64Res = InstallMsvcFfmpeg -isArm64 $true
|
||||
function InstallFfmpegsAMD64 {
|
||||
$hostArch = "amd64"
|
||||
$mingwRes = InstallMingwFfmpeg
|
||||
$llvmMingwRes = InstallLlvmMingwFfmpeg
|
||||
$androidArmV7Res = InstallAndroidArmv7
|
||||
$msvcRes = InstallMsvcFfmpeg -hostArch $hostArch -isArm64 $false
|
||||
$msvcArm64Res = InstallMsvcFfmpeg -hostArch $hostArch -isArm64 $true
|
||||
|
||||
Write-Host "Ffmpeg installation results:"
|
||||
Write-Host " mingw:" $(if ($mingwRes) { "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 " android-armv7:" $(if ($androidArmV7Res) { "OK" } else { "FAIL" })
|
||||
Write-Host "Ffmpeg installation results:"
|
||||
Write-Host " mingw:" $(if ($mingwRes) { "OK" } else { "FAIL" })
|
||||
Write-Host " llvm-mingw:" $(if ($llvmMingwRes) { "OK" } else { "FAIL" })
|
||||
Write-Host " android-armv7:" $(if ($androidArmV7Res) { "OK" } else { "FAIL" })
|
||||
Write-Host " msvc:" $(if ($msvcRes) { "OK" } else { "FAIL" })
|
||||
Write-Host " msvc-arm64:" $(if ($msvcArm64Res) { "OK" } else { "FAIL" })
|
||||
|
||||
exit $(if ($mingwRes -and $msvcRes -and $msvcArm64Res -and $llvmMingwRes -and $androidArmV7Res) { 0 } else { 1 })
|
||||
exit $(if ($mingwRes -and $msvcRes -and $msvcArm64Res -and $llvmMingwRes -and $androidArmV7Res) { 0 } else { 1 })
|
||||
}
|
||||
|
||||
function InstallFfmpegsARM64 {
|
||||
$hostArch = "arm64"
|
||||
$msvcArm64Res = InstallMsvcFfmpeg -hostArch $hostArch -isArm64 $true
|
||||
|
||||
Write-Host "Ffmpeg installation results:"
|
||||
Write-Host " msvc-arm64:" $(if ($msvcArm64Res) { "OK" } else { "FAIL" })
|
||||
|
||||
exit $(if ($msvcArm64Res) { 0 } else { 1 })
|
||||
}
|
||||
|
||||
$cpu_arch = Get-CpuArchitecture
|
||||
switch ($cpu_arch) {
|
||||
arm64 {
|
||||
InstallFfmpegsARM64
|
||||
Break
|
||||
}
|
||||
x64 {
|
||||
InstallFfmpegsAMD64
|
||||
Break
|
||||
}
|
||||
default {
|
||||
throw "Unknown architecture $cpu_arch"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
. "$PSScriptRoot\..\common\windows\install-msys2.ps1"
|
||||
@@ -0,0 +1 @@
|
||||
. "$PSScriptRoot\..\common\windows\install-ffmpeg.ps1"
|
||||
Reference in New Issue
Block a user