Initial commit: RustDesk 1.4.7 macOS desktop port

- Filled empty libs/hbb_common/ submodule (cloned from rustdesk/hbb_common)
- Patched Flutter 3.44 / Dart 3.12 compatibility:
  * flutter/lib/generated_bridge.dart: asTypedList with cast<>, DartPort=Int64
  * flutter/lib/common.dart: DialogTheme->DialogThemeData, TabBarTheme->TabBarThemeData
  * flutter/pubspec.yaml: extended_text 14.0.0->15.0.2, google_fonts override 5.0.0
  * flutter/macos/Runner/Configs/Release.xcconfig: EXCLUDED_ARCHS=x86_64
- Build verified: cargo check + cargo build --features flutter + cargo build --release --features flutter
- Verified flutter build macos --debug and --release both produce working .app
- Verified .dmg installer (27MB arm64) created via hdiutil
- Build deps: Xcode 26.5, CocoaPods 1.16.2, Flutter 3.44, VCPKG arm64-osx
This commit is contained in:
xuwenwei
2026-06-08 21:42:20 +08:00
parent 3d8db09123
commit d3b6026bfd
840 changed files with 291780 additions and 1 deletions
+60
View File
@@ -0,0 +1,60 @@
diff --git a/build/cmake/cpu.cmake b/build/cmake/cpu.cmake
index acebe20..8c67d89 100644
--- a/build/cmake/cpu.cmake
+++ b/build/cmake/cpu.cmake
@@ -120,6 +120,19 @@ elseif("${AOM_TARGET_CPU}" MATCHES "^x86")
set(RTCD_ARCH_X86_64 "yes")
endif()
+ # AVX2 requires __m256i definition starting v3.9.0
+
+ if(ENABLE_AVX2)
+ aom_check_source_compiles("x86_64_avx2_m256i_available" "
+#include <emmintrin.h>
+#ifndef __m256i
+#error 1
+#endif" HAVE_AVX2_M256I)
+ if(HAVE_AVX2_M256I EQUAL 0)
+ set(ENABLE_AVX2 0)
+ endif()
+ endif()
+
set(X86_FLAVORS "MMX;SSE;SSE2;SSE3;SSSE3;SSE4_1;SSE4_2;AVX;AVX2")
foreach(flavor ${X86_FLAVORS})
if(ENABLE_${flavor} AND NOT disable_remaining_flavors)
diff --git a/aom_dsp/x86/synonyms.h b/aom_dsp/x86/synonyms.h
index 0d51cdf..6744ec5 100644
--- a/aom_dsp/x86/synonyms.h
+++ b/aom_dsp/x86/synonyms.h
@@ -46,13 +46,6 @@ static INLINE __m128i xx_loadu_128(const void *a) {
return _mm_loadu_si128((const __m128i *)a);
}
-// Load 64 bits from each of hi and low, and pack into an SSE register
-// Since directly loading as `int64_t`s and using _mm_set_epi64 may violate
-// the strict aliasing rule, this takes a different approach
-static INLINE __m128i xx_loadu_2x64(const void *hi, const void *lo) {
- return _mm_unpacklo_epi64(_mm_loadu_si64(lo), _mm_loadu_si64(hi));
-}
-
static INLINE void xx_storel_32(void *const a, const __m128i v) {
const int val = _mm_cvtsi128_si32(v);
memcpy(a, &val, sizeof(val));
diff --git a/aom_dsp/x86/synonyms_avx2.h b/aom_dsp/x86/synonyms_avx2.h
index d4e8f69..45be17e 100644
--- a/aom_dsp/x86/synonyms_avx2.h
+++ b/aom_dsp/x86/synonyms_avx2.h
@@ -25,6 +25,13 @@
* Intrinsics prefixed with yy_ operate on or return 256bit YMM registers.
*/
+// Load 64 bits from each of hi and low, and pack into an SSE register
+// Since directly loading as `int64_t`s and using _mm_set_epi64 may violate
+// the strict aliasing rule, this takes a different approach
+static INLINE __m128i xx_loadu_2x64(const void *hi, const void *lo) {
+ return _mm_unpacklo_epi64(_mm_loadu_si64(lo), _mm_loadu_si64(hi));
+}
+
// Loads and stores to do away with the tedium of casting the address
// to the right type.
static INLINE __m256i yy_load_256(const void *a) {
+75
View File
@@ -0,0 +1,75 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 18190f647..f4b1b359d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,6 +23,9 @@ endif()
project(AOM C CXX)
+include(GNUInstallDirs)
+include(CMakePackageConfigHelpers)
+
# GENERATED source property global visibility.
if(POLICY CMP0118)
cmake_policy(SET CMP0118 NEW)
@@ -302,6 +305,52 @@ if(BUILD_SHARED_LIBS)
set(AOM_LIB_TARGETS ${AOM_LIB_TARGETS} aom_static)
endif()
+set(PUBLIC_HEADERS
+ aom/aom.h
+ aom/aom_codec.h
+ aom/aom_decoder.h
+ aom/aom_encoder.h
+ aom/aom_frame_buffer.h
+ aom/aom_image.h
+ aom/aom_integer.h
+ aom/aomcx.h
+ aom/aomdx.h
+)
+
+set_target_properties(aom PROPERTIES
+ PUBLIC_HEADER "${PUBLIC_HEADERS}")
+
+
+target_include_directories(aom
+ PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+ $<INSTALL_INTERFACE:include>)
+
+install(TARGETS aom
+ EXPORT unofficial-aom-targets
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
+ PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/aom")
+
+install(EXPORT unofficial-aom-targets
+ FILE unofficial-aom-targets.cmake
+ NAMESPACE unofficial::
+ DESTINATION lib/cmake/aom)
+
+configure_package_config_file(cmake/aom-config.cmake.in
+ ${CMAKE_CURRENT_BINARY_DIR}/aom-config.cmake
+ INSTALL_DESTINATION lib/cmake/aom
+ NO_SET_AND_CHECK_MACRO
+ NO_CHECK_REQUIRED_COMPONENTS_MACRO)
+
+write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/aom-config-version.cmake
+ VERSION ${SO_FILE_VERSION}
+ COMPATIBILITY SameMajorVersion)
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/aom-config.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/aom-config-version.cmake
+ DESTINATION lib/cmake/aom)
+
# Setup dependencies.
if(CONFIG_THREE_PASS)
setup_ivf_dec_targets()
diff --git a/cmake/aom-config.cmake.in b/cmake/aom-config.cmake.in
new file mode 100644
index 000000000..91cac3b5b
--- /dev/null
+++ b/cmake/aom-config.cmake.in
@@ -0,0 +1,2 @@
+@PACKAGE_INIT@
+include(${CMAKE_CURRENT_LIST_DIR}/unofficial-aom-targets.cmake)
@@ -0,0 +1,13 @@
diff --git a/build/cmake/aom_configure.cmake b/build/cmake/aom_configure.cmake
index aaef2c310..5500ad4a3 100644
--- a/build/cmake/aom_configure.cmake
+++ b/build/cmake/aom_configure.cmake
@@ -309,6 +309,8 @@ if(MSVC)
# Disable MSVC warnings that suggest making code non-portable.
add_compiler_flag_if_supported("/wd4996")
+ # Disable MSVC warnings for potentially uninitialized local pointer variable.
+ add_compiler_flag_if_supported("/wd4703")
if(ENABLE_WERROR)
add_compiler_flag_if_supported("/WX")
endif()
+79
View File
@@ -0,0 +1,79 @@
# NASM is required to build AOM
vcpkg_find_acquire_program(NASM)
get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY)
vcpkg_add_to_path(${NASM_EXE_PATH})
# Perl is required to build AOM
vcpkg_find_acquire_program(PERL)
get_filename_component(PERL_PATH ${PERL} DIRECTORY)
vcpkg_add_to_path(${PERL_PATH})
if(DEFINED ENV{USE_AOM_391})
vcpkg_from_git(
OUT_SOURCE_PATH SOURCE_PATH
URL "https://aomedia.googlesource.com/aom"
REF 8ad484f8a18ed1853c094e7d3a4e023b2a92df28 # 3.9.1
PATCHES
aom-uninitialized-pointer.diff
aom-avx2.diff
aom-install.diff
)
else()
vcpkg_from_git(
OUT_SOURCE_PATH SOURCE_PATH
URL "https://aomedia.googlesource.com/aom"
REF 10aece4157eb79315da205f39e19bf6ab3ee30d0 # 3.12.1
PATCHES
aom-uninitialized-pointer.diff
# aom-avx2.diff
# Can be dropped when https://bugs.chromium.org/p/aomedia/issues/detail?id=3029 is merged into the upstream
aom-install.diff
)
endif()
set(aom_target_cpu "")
if(VCPKG_TARGET_IS_UWP OR (VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE MATCHES "^arm"))
# UWP + aom's assembler files result in weirdness and build failures
# Also, disable assembly on ARM and ARM64 Windows to fix compilation issues.
set(aom_target_cpu "-DAOM_TARGET_CPU=generic")
endif()
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" AND VCPKG_TARGET_IS_LINUX)
set(aom_target_cpu "-DENABLE_NEON=OFF")
endif()
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
${aom_target_cpu}
-DENABLE_DOCS=OFF
-DENABLE_EXAMPLES=OFF
-DENABLE_TESTDATA=OFF
-DENABLE_TESTS=OFF
-DENABLE_TOOLS=OFF
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/aom.pc" " -lm" "")
if(NOT VCPKG_BUILD_TYPE)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/aom.pc" " -lm" "")
endif()
endif()
# Move cmake configs
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})
# Remove duplicate files
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include
${CURRENT_PACKAGES_DIR}/debug/share)
# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
vcpkg_fixup_pkgconfig()
+18
View File
@@ -0,0 +1,18 @@
{
"name": "aom",
"version-semver": "3.12.1",
"port-version": 0,
"description": "AV1 codec library",
"homepage": "https://aomedia.googlesource.com/aom",
"license": "BSD-2-Clause",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}