diff --git a/.cargo/config.toml b/.cargo/config.toml index 42a4adb55..f691dd8af 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -2,6 +2,8 @@ rustflags = ["-Ctarget-feature=+crt-static"] [target.i686-pc-windows-msvc] rustflags = ["-C", "target-feature=+crt-static", "-C", "link-args=/NODEFAULTLIB:MSVCRT"] +[target.aarch64-pc-windows-msvc] +rustflags = ["-Ctarget-feature=+crt-static"] [target.'cfg(target_os="macos")'] rustflags = [ "-C", "link-args=-sectcreate __CGPreLoginApp __cgpreloginapp /dev/null", diff --git a/.github/patches/apply_flutter_3.44_source_patches.sh b/.github/patches/apply_flutter_3.44_source_patches.sh new file mode 100644 index 000000000..3a7ab99dc --- /dev/null +++ b/.github/patches/apply_flutter_3.44_source_patches.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# Applies the Flutter 3.44-only source/pubspec changes on the fly, in CI only. +# +# Windows arm64 needs Flutter >= 3.44 (the first stable release shipping an arm64 Dart SDK + +# engine), which renamed DialogTheme/TabBarTheme -> *Data and needs newer extended_text/ +# google_fonts. Every other platform is still on Flutter 3.24.5, where the old names/versions +# are required, so these changes are kept OUT of the committed sources and applied here instead. +# +# Used by BOTH the Windows arm64 build (flutter-build.yml) and its dedicated bridge artifact +# (bridge.yml) so they share an identical 3.44 source state -- the generated *.freezed.dart must +# compile against the same Flutter/freezed version the arm64 build resolves. +# +# Remove this script (and commit the changes) once upstream bumps Flutter across the board. +# +# Run from the repository root. sed is used (not a git-apply patch) because the checked-out +# sources are CRLF on the windows-11-arm runner; the substitutions below are anchor-free and +# therefore CRLF-safe. +set -euo pipefail + +# ThemeData API renames (Flutter 3.27+): +sed -i 's/dialogTheme: DialogTheme(/dialogTheme: DialogThemeData(/g' flutter/lib/common.dart +sed -i 's/tabBarTheme: const TabBarTheme(/tabBarTheme: const TabBarThemeData(/g' flutter/lib/common.dart +sed -i '/static ThemeData lightTheme = ThemeData(/,/static ThemeData darkTheme = ThemeData(/s/dialogTheme: DialogThemeData(/dialogTheme: DialogThemeData(\ + backgroundColor: Colors.white,/' flutter/lib/common.dart +sed -i '/static ThemeData darkTheme = ThemeData(/,/scrollbarTheme: scrollbarThemeDark,/s/dialogTheme: DialogThemeData(/dialogTheme: DialogThemeData(\ + backgroundColor: Color(0xFF18191E),/' flutter/lib/common.dart +# Dependency bumps required by the newer Dart/Flutter: +sed -i 's/extended_text: 14.0.0/extended_text: 15.0.2/' flutter/pubspec.yaml +sed -i 's/google_fonts: \^6.2.1/google_fonts: ^8.1.0/' flutter/pubspec.yaml + +# Fail loudly if any expected string drifted, so we never silently build unpatched: +grep -qF 'dialogTheme: DialogThemeData(' flutter/lib/common.dart +grep -qF 'tabBarTheme: const TabBarThemeData(' flutter/lib/common.dart +grep -qF 'backgroundColor: Colors.white,' flutter/lib/common.dart +grep -qF 'backgroundColor: Color(0xFF18191E),' flutter/lib/common.dart +grep -qF 'extended_text: 15.0.2' flutter/pubspec.yaml +grep -qF 'google_fonts: ^8.1.0' flutter/pubspec.yaml + +git --no-pager diff -- flutter/lib/common.dart flutter/pubspec.yaml diff --git a/.github/workflows/bridge.yml b/.github/workflows/bridge.yml index aba682990..a7b74fa55 100644 --- a/.github/workflows/bridge.yml +++ b/.github/workflows/bridge.yml @@ -7,7 +7,6 @@ on: env: CARGO_EXPAND_VERSION: "1.0.95" - FLUTTER_VERSION: "3.22.3" FLUTTER_RUST_BRIDGE_VERSION: "1.80.1" RUST_VERSION: "1.75" # https://github.com/rustdesk/rustdesk/discussions/7503 @@ -18,10 +17,21 @@ jobs: fail-fast: false matrix: job: + # Default bridge for every platform still on Flutter 3.24.5 (generated with 3.22.3). - { target: x86_64-unknown-linux-gnu, os: ubuntu-22.04, extra-build-args: "", + flutter-version: "3.22.3", + artifact-name: "bridge-artifact", + } + # Dedicated bridge for the Windows arm64 build (Flutter 3.44); runs in parallel. + - { + target: x86_64-unknown-linux-gnu, + os: ubuntu-22.04, + extra-build-args: "", + flutter-version: "3.44.0", + artifact-name: "bridge-artifact-flutter-3.44", } steps: - name: Checkout source code @@ -64,13 +74,13 @@ jobs: uses: actions/cache@6f8efc29b200d32929f49075959781ed54ec270c # v3 with: path: /tmp/flutter_rust_bridge - key: vcpkg-${{ matrix.job.arch }} + key: bridge-${{ matrix.job.flutter-version }} - name: Install flutter uses: subosito/flutter-action@1a449444c387b1966244ae4d4f8c696479add0b2 # v2 with: channel: "stable" - flutter-version: ${{ env.FLUTTER_VERSION }} + flutter-version: ${{ matrix.job.flutter-version }} cache: true - name: Install flutter rust bridge deps @@ -78,7 +88,15 @@ jobs: run: | cargo install cargo-expand --version ${{ env.CARGO_EXPAND_VERSION }} --locked cargo install flutter_rust_bridge_codegen --version ${{ env.FLUTTER_RUST_BRIDGE_VERSION }} --features "uuid" --locked - pushd flutter && sed -i -e 's/extended_text: 14.0.0/extended_text: 13.0.0/g' pubspec.yaml && flutter pub get && popd + if [[ "${{ matrix.job.flutter-version }}" == "3.22.3" ]]; then + # Default Flutter 3.22.3: extended_text 14 needs a newer Dart, so downgrade for resolution. + sed -i -e 's/extended_text: 14.0.0/extended_text: 13.0.0/g' flutter/pubspec.yaml + else + # Flutter 3.44 bridge for Windows arm64: match that build's source/pubspec state so the + # generated *.freezed.dart compiles against the same Flutter/freezed it resolves. + bash .github/patches/apply_flutter_3.44_source_patches.sh + fi + pushd flutter && flutter pub get && popd - name: Run flutter rust bridge run: | @@ -88,7 +106,7 @@ jobs: - name: Upload Artifact uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: - name: bridge-artifact + name: ${{ matrix.job.artifact-name }} path: | ./src/bridge_generated.rs ./src/bridge_generated.io.rs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 61b4713de..173eda9f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,6 +81,7 @@ jobs: # - { target: x86_64-apple-darwin , os: macos-10.15 } # - { target: x86_64-pc-windows-gnu , os: windows-2022 } # - { target: x86_64-pc-windows-msvc , os: windows-2022 } + # - { target: aarch64-pc-windows-msvc , os: windows-11-arm } - { target: x86_64-unknown-linux-gnu , os: ubuntu-24.04 } # - { target: x86_64-unknown-linux-musl , os: ubuntu-20.04, use-cross: true } steps: diff --git a/.github/workflows/flutter-build.yml b/.github/workflows/flutter-build.yml index c7739970f..6cc2900f7 100644 --- a/.github/workflows/flutter-build.yml +++ b/.github/workflows/flutter-build.yml @@ -27,6 +27,11 @@ env: LLVM_VERSION: "15.0.6" FLUTTER_VERSION: "3.24.5" ANDROID_FLUTTER_VERSION: "3.24.5" + # Windows arm64 only: the first stable Flutter to ship a native arm64 Windows Dart SDK + + # engine is 3.44. Every other platform stays on FLUTTER_VERSION (3.24.5) until Windows 7 + # support is restored after the upstream-wide Flutter bump. The arm64 job patches the few + # 3.44-only source/pubspec changes on the fly (see "Patch RustDesk sources for Flutter 3.44"). + FLUTTER_WINDOWS_ARM_VERSION: "3.44.0" # for arm64 linux because official Dart SDK does not work FLUTTER_ELINUX_VERSION: "3.16.9" TAG_NAME: "${{ inputs.upload-tag }}" @@ -76,9 +81,20 @@ jobs: target: x86_64-pc-windows-msvc, os: windows-2022, arch: x86_64, + flutter-arch: x64, vcpkg-triplet: x64-windows-static, + build-args: "--vram", + } + - { + target: aarch64-pc-windows-msvc, + os: windows-11-arm, + arch: aarch64, + flutter-arch: arm64, + vcpkg-triplet: arm64-windows-static, + # vram is x86/x64-only (NVENC needs CUDA, Intel MediaSDK needs __rdtsc); + # no NV/Intel/AMD hardware exists on Windows-on-ARM, so vram stays disabled here. + build-args: "", } - # - { target: aarch64-pc-windows-msvc, os: windows-2022, arch: aarch64 } steps: - name: Export GitHub Actions cache environment variables uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6 @@ -95,36 +111,91 @@ jobs: - name: Restore bridge files uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: - name: bridge-artifact + # arm64 is on Flutter 3.44, so it needs the bridge generated with the same Flutter + # (its *.freezed.dart must match the freezed the arm64 build resolves). x64 and every + # other platform keep the default 3.22.3-generated bridge. + name: ${{ matrix.job.arch == 'aarch64' && 'bridge-artifact-flutter-3.44' || 'bridge-artifact' }} path: ./ - name: Install LLVM and Clang - uses: KyleMayes/install-llvm-action@1a3da29f56261a1e1f937ec88f0856a9b8321d7e # v1 + uses: KyleMayes/install-llvm-action@ebc0426251bc40c7cd31162802432c68818ab8f0 # v2.0.9 with: version: ${{ env.LLVM_VERSION }} - name: Install flutter + id: flutter + # arm64 builds with FLUTTER_WINDOWS_ARM_VERSION (>=3.44); x64 stays on FLUTTER_VERSION. + # subosito only ships an x64 Windows SDK (Flutter's release manifest lists x64 only), + # so it installs x64 on both arches. The arm64 runner re-bootstraps Dart to arm64 in + # the next step. uses: subosito/flutter-action@2783a3f08e1baf891508463f8c6653c258246225 # v2.12.0; https://github.com/subosito/flutter-action/issues/277 with: channel: "stable" - flutter-version: ${{ env.FLUTTER_VERSION }} + flutter-version: ${{ matrix.job.arch == 'aarch64' && env.FLUTTER_WINDOWS_ARM_VERSION || env.FLUTTER_VERSION }} + architecture: x64 + + - name: Force arm64 Dart SDK + engine + # The x64 SDK subosito installs bundles an x64 Dart with a matching engine-dart-sdk.stamp, + # so update_dart_sdk.ps1 short-circuits (stamp matches -> return) and keeps x64 Dart; + # `flutter build windows` then targets the Dart VM's arch = x64, even on this arm64 host. + # On this native-arm64 runner (PROCESSOR_ARCHITECTURE=ARM64), deleting the stamp and + # re-running update_dart_sdk.ps1 pulls the arm64 Dart (available since Flutter 3.44.0). + # https://github.com/flutter/flutter/issues/186730#issuecomment-4573214964 + if: ${{ matrix.job.arch == 'aarch64' }} + run: | + $flutterRoot = "${{ steps.flutter.outputs['CACHE-PATH'] }}" + Write-Host "PROCESSOR_ARCHITECTURE=$env:PROCESSOR_ARCHITECTURE" + Write-Host "Flutter root: $flutterRoot" + Remove-Item -Force "$flutterRoot\bin\cache\engine-dart-sdk.stamp" -ErrorAction SilentlyContinue + & "$flutterRoot\bin\internal\update_dart_sdk.ps1" + # Confirm the Dart we ended up with is arm64 ("on windows_arm64"); fail loudly if not. + $dartVer = & "$flutterRoot\bin\dart.bat" --version 2>&1 | Out-String + Write-Host $dartVer + if ($dartVer -notmatch "windows_arm64") { + Write-Error "Expected an arm64 Dart SDK but got: $dartVer" + exit 1 + } + & "$flutterRoot\bin\flutter.bat" precache --windows + # Fail fast if precache pulled the wrong-arch Windows engine: an arm64 Dart should + # fetch windows-arm64 engine artifacts. Bailing here saves the ~25min Rust build. + $engineDir = "$flutterRoot\bin\cache\artifacts\engine" + Write-Host "Engine artifacts present:" + Get-ChildItem $engineDir -Directory | Select-Object -ExpandProperty Name | Write-Host + if (-not (Test-Path "$engineDir\windows-arm64-release")) { + Write-Error "Expected windows-arm64-release engine artifacts but they are missing (wrong-arch SDK)." + exit 1 + } # https://github.com/flutter/flutter/issues/155685 + # x64 only: arm64 uses the stock native arm64 Windows engine, and the rustdesk/engine + # windows-x64-release.zip is built for the 3.24-era x64 engine (matches FLUTTER_VERSION). - name: Replace engine with rustdesk custom flutter engine + if: ${{ matrix.job.arch == 'x86_64' }} run: | flutter doctor -v flutter precache --windows Invoke-WebRequest -Uri https://github.com/rustdesk/engine/releases/download/main/windows-x64-release.zip -OutFile windows-x64-release.zip Expand-Archive -Path windows-x64-release.zip -DestinationPath windows-x64-release - mv -Force windows-x64-release/*  C:/hostedtoolcache/windows/flutter/stable-${{ env.FLUTTER_VERSION }}-x64/bin/cache/artifacts/engine/windows-x64-release/ + mv -Force windows-x64-release/* C:/hostedtoolcache/windows/flutter/stable-${{ env.FLUTTER_VERSION }}-x64/bin/cache/artifacts/engine/windows-x64-release/ - name: Patch flutter + # x64 stays on Flutter 3.24.5, which needs the dropdown filter patch. + # arm64 is on Flutter 3.44 (patched separately below) and does not use this patch. + if: ${{ matrix.job.arch == 'x86_64' }} shell: bash run: | cp .github/patches/flutter_3.24.4_dropdown_menu_enableFilter.diff $(dirname $(dirname $(which flutter))) cd $(dirname $(dirname $(which flutter))) [[ "3.24.5" == ${{env.FLUTTER_VERSION}} ]] && git apply flutter_3.24.4_dropdown_menu_enableFilter.diff + - name: Patch RustDesk sources for Flutter 3.44 (arm64) + # arm64 is the only target on Flutter 3.44; apply its source/pubspec deltas on the fly + # (shared with the 3.44 bridge job) so the committed sources stay on Flutter 3.24.5. + # `flutter build` then runs `pub get`, regenerating pubspec.lock for the bumped deps. + if: ${{ matrix.job.arch == 'aarch64' }} + shell: bash + run: bash .github/patches/apply_flutter_3.44_source_patches.sh + - name: Install Rust toolchain uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1 with: @@ -163,11 +234,19 @@ jobs: head -n 100 "${VCPKG_ROOT}/buildtrees/ffmpeg/build-${{ matrix.job.vcpkg-triplet }}-rel-out.log" || true shell: bash + - name: Set SODIUM_LIB_DIR (arm64) + # libsodium-sys ships no arm64 Windows prebuilt lib; point it at the vcpkg-built one + # (only for arm64 — leaving it unset lets x64 use the crate's bundled lib). + if: ${{ matrix.job.arch == 'aarch64' }} + shell: bash + run: echo "SODIUM_LIB_DIR=$VCPKG_ROOT/installed/${{ matrix.job.vcpkg-triplet }}/lib" >> "$GITHUB_ENV" + - name: Build rustdesk run: | # Windows: build RustDesk - python3 .\build.py --portable --hwcodec --flutter --vram --skip-portable-pack - mv ./flutter/build/windows/x64/runner/Release ./rustdesk + # --hwcodec is shared by all Windows targets; per-target extras (e.g. --vram) come from the matrix + python3 .\build.py --portable --flutter --skip-portable-pack --hwcodec ${{ matrix.job.build-args }} + mv ./flutter/build/windows/${{ matrix.job.flutter-arch }}/runner/Release ./rustdesk # Download usbmmidd_v2.zip and extract it to ./rustdesk Invoke-WebRequest -Uri https://github.com/rustdesk-org/rdev/releases/download/usbmmidd_v2/usbmmidd_v2.zip -OutFile usbmmidd_v2.zip @@ -256,13 +335,18 @@ jobs: uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2 - name: Build msi + # Builds the MSI for the matrix arch. res/msi (WiX v4 + native CustomActions) carries + # both x64 and ARM64 platform configs; WcaUtil/DUtil ship arm64 libs. msbuild platform + # is x64 / ARM64; the produced Package.msi is globbed since its bin// dir varies. if: env.UPLOAD_ARTIFACT == 'true' run: | pushd ./res/msi python preprocess.py --arp -d ../../rustdesk nuget restore msi.sln - msbuild msi.sln -p:Configuration=Release -p:Platform=x64 /p:TargetVersion=Windows10 - mv ./Package/bin/x64/Release/en-us/Package.msi ../../SignOutput/rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}.msi + $msiPlatform = if ('${{ matrix.job.arch }}' -eq 'aarch64') { 'ARM64' } else { 'x64' } + msbuild msi.sln -p:Configuration=Release -p:Platform=$msiPlatform /p:TargetVersion=Windows10 + $msi = Get-ChildItem ./Package/bin/*/Release/en-us/Package.msi | Select-Object -First 1 + mv $msi.FullName ../../SignOutput/rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}.msi sha256sum ../../SignOutput/rustdesk-*.msi - name: Sign rustdesk self-extracted file diff --git a/Cargo.lock b/Cargo.lock index 853d08c1d..e44cc014a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2329,7 +2329,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.8.4", + "libloading 0.7.4", ] [[package]] @@ -2694,7 +2694,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.60.2", ] [[package]] @@ -4494,7 +4494,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" dependencies = [ "cfg-if 1.0.0", - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] @@ -4695,7 +4695,7 @@ dependencies = [ [[package]] name = "magnum-opus" version = "0.4.0" -source = "git+https://github.com/rustdesk-org/magnum-opus#5cd2bf989c148662fa3a2d9d539a71d71fd1d256" +source = "git+https://github.com/rustdesk-org/magnum-opus#588c6e1f9ed50c3a01fa64f3bd3e7cdb0378a114" dependencies = [ "bindgen 0.59.2", "pkg-config", @@ -6673,7 +6673,7 @@ dependencies = [ "once_cell", "socket2 0.5.10", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.60.2", ] [[package]] @@ -7457,7 +7457,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys 0.11.0", - "windows-sys 0.52.0", + "windows-sys 0.60.2", ] [[package]] @@ -7514,7 +7514,7 @@ dependencies = [ "security-framework 3.5.1", "security-framework-sys", "webpki-root-certs", - "windows-sys 0.52.0", + "windows-sys 0.60.2", ] [[package]] diff --git a/build.py b/build.py index 894a7808d..957961857 100755 --- a/build.py +++ b/build.py @@ -17,7 +17,8 @@ osx = platform.platform().startswith( hbb_name = 'rustdesk' + ('.exe' if windows else '') exe_path = 'target/release/' + hbb_name if windows: - flutter_build_dir = 'build/windows/x64/runner/Release/' + win_arch = 'arm64' if platform.machine().lower() in ('arm64', 'aarch64') else 'x64' + flutter_build_dir = f'build/windows/{win_arch}/runner/Release/' elif osx: flutter_build_dir = 'build/macos/Build/Products/Release/' else: @@ -410,7 +411,12 @@ def build_flutter_dmg(version, features): system2( "cp target/release/liblibrustdesk.dylib target/release/librustdesk.dylib") os.chdir('flutter') - system2('flutter build macos --release') + # cargo builds a single-arch dylib for the host; restrict Xcode to the same arch + # so the universal-by-default ARCHS_STANDARD doesn't try to link a missing slice. + # FLUTTER_XCODE_* env vars are forwarded to xcodebuild as build settings. + mac_arch = 'arm64' if platform.machine().lower() in ('arm64', 'aarch64') else 'x86_64' + system2( + f'FLUTTER_XCODE_ARCHS={mac_arch} FLUTTER_XCODE_ONLY_ACTIVE_ARCH=YES flutter build macos --release') system2('cp -rf ../target/release/service ./build/macos/Build/Products/Release/RustDesk.app/Contents/MacOS/') ''' system2( @@ -506,6 +512,7 @@ def main(): 'target\\release\\rustdesk.exe') else: print('Not signed') + os.makedirs(res_dir, exist_ok=True) system2( f'cp -rf target/release/RustDesk.exe {res_dir}') os.chdir('libs/portable') diff --git a/libs/scrap/build.rs b/libs/scrap/build.rs index 73765055d..cdee4d5ec 100644 --- a/libs/scrap/build.rs +++ b/libs/scrap/build.rs @@ -47,7 +47,7 @@ fn link_vcpkg(mut path: PathBuf, name: &str) -> PathBuf { format!("{}-{}", target_arch, target_os) } } else if target_os == "windows" { - "x64-windows-static".to_owned() + format!("{}-windows-static", target_arch) } else { format!("{}-{}", target_arch, target_os) }; diff --git a/res/msi/CustomActions/CustomActions.vcxproj b/res/msi/CustomActions/CustomActions.vcxproj index 2e704fbb5..09634e475 100644 --- a/res/msi/CustomActions/CustomActions.vcxproj +++ b/res/msi/CustomActions/CustomActions.vcxproj @@ -7,6 +7,10 @@ Release x64 + + Release + ARM64 + Win32Proj @@ -22,6 +26,12 @@ true Unicode + + DynamicLibrary + false + true + Unicode + @@ -30,6 +40,9 @@ + + + @@ -53,6 +66,28 @@ CustomActions.def + + + Level3 + true + true + true + NDEBUG;EXAMPLECADLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + MultiThreaded + + + msi.lib;version.lib;%(AdditionalDependencies) + Windows + true + true + true + false + CustomActions.def + + @@ -65,6 +100,7 @@ Create + Create diff --git a/res/msi/Package/Package.wixproj b/res/msi/Package/Package.wixproj index 17dbc4f13..6398d11a2 100644 --- a/res/msi/Package/Package.wixproj +++ b/res/msi/Package/Package.wixproj @@ -3,7 +3,7 @@ Release - x64 + x64;ARM64 diff --git a/res/msi/msi.sln b/res/msi/msi.sln index 70d28fb86..4b5d191a9 100644 --- a/res/msi/msi.sln +++ b/res/msi/msi.sln @@ -10,12 +10,17 @@ EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Release|x64 = Release|x64 + Release|ARM64 = Release|ARM64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {F403A403-CEFF-4399-B51C-CC646C8E98CF}.Release|x64.ActiveCfg = Release|x64 {F403A403-CEFF-4399-B51C-CC646C8E98CF}.Release|x64.Build.0 = Release|x64 + {F403A403-CEFF-4399-B51C-CC646C8E98CF}.Release|ARM64.ActiveCfg = Release|ARM64 + {F403A403-CEFF-4399-B51C-CC646C8E98CF}.Release|ARM64.Build.0 = Release|ARM64 {6B3647E0-B4A3-46AE-8757-A22EE51C1DAC}.Release|x64.ActiveCfg = Release|x64 {6B3647E0-B4A3-46AE-8757-A22EE51C1DAC}.Release|x64.Build.0 = Release|x64 + {6B3647E0-B4A3-46AE-8757-A22EE51C1DAC}.Release|ARM64.ActiveCfg = Release|ARM64 + {6B3647E0-B4A3-46AE-8757-A22EE51C1DAC}.Release|ARM64.Build.0 = Release|ARM64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/res/vcpkg/ffmpeg/portfile.cmake b/res/vcpkg/ffmpeg/portfile.cmake index 16cef8350..6ee760f43 100644 --- a/res/vcpkg/ffmpeg/portfile.cmake +++ b/res/vcpkg/ffmpeg/portfile.cmake @@ -130,14 +130,18 @@ elseif(VCPKG_TARGET_IS_WINDOWS) --cc=cl \ --enable-gpl \ --enable-d3d11va \ ---enable-cuda \ ---enable-ffnvcodec \ ---enable-hwaccel=h264_nvdec \ ---enable-hwaccel=hevc_nvdec \ --enable-hwaccel=h264_d3d11va \ --enable-hwaccel=hevc_d3d11va \ --enable-hwaccel=h264_d3d11va2 \ --enable-hwaccel=hevc_d3d11va2 \ +") + + if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") + string(APPEND OPTIONS "\ +--enable-cuda \ +--enable-ffnvcodec \ +--enable-hwaccel=h264_nvdec \ +--enable-hwaccel=hevc_nvdec \ --enable-amf \ --enable-encoder=h264_amf \ --enable-encoder=hevc_amf \ @@ -147,6 +151,7 @@ elseif(VCPKG_TARGET_IS_WINDOWS) --enable-encoder=h264_qsv \ --enable-encoder=hevc_qsv \ ") + endif() if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") set(LIB_MACHINE_ARG /machine:x86) @@ -154,6 +159,9 @@ elseif(VCPKG_TARGET_IS_WINDOWS) elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") set(LIB_MACHINE_ARG /machine:x64) string(APPEND OPTIONS " --arch=x86_64") + elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") + set(LIB_MACHINE_ARG /machine:arm64) + string(APPEND OPTIONS " --arch=aarch64 --enable-cross-compile") else() message(FATAL_ERROR "Unsupported target architecture") endif() diff --git a/vcpkg.json b/vcpkg.json index d41b91c22..634c32b19 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -20,6 +20,11 @@ "name": "libjpeg-turbo", "host": false }, + { + "name": "libsodium", + "host": false, + "platform": "windows & arm64" + }, { "name": "oboe", "platform": "android" @@ -64,15 +69,15 @@ "features": [ { "name": "amf", - "platform": "((windows | linux) & static)" + "platform": "(((windows & !arm) | linux) & static)" }, { "name": "nvcodec", - "platform": "((windows | linux) & static)" + "platform": "(((windows & !arm) | linux) & static)" }, { "name": "qsv", - "platform": "(windows & static)" + "platform": "(windows & !arm & static)" } ], "platform": "((windows | (linux & !arm32) | osx) & static)"