assistd / scrcpy

Apache License 2.0
0 stars 1 forks source link

m1 macOS编译 #2

Open prife opened 1 year ago

prife commented 1 year ago

m1 macOS上编译scrcpy client失败,解决方法

diff --git a/app/meson.build b/app/meson.build
index a86c1dee..413ab698 100644
--- a/app/meson.build
+++ b/app/meson.build
@@ -93,12 +93,15 @@ crossbuild_windows = meson.is_cross_build() and host_machine.system() == 'window

 if not crossbuild_windows

+    sdldep = dependency('sdl2', version: '>= 2.0.5')
+    sdldep_include = sdldep.get_variable(pkgconfig : 'includedir')
+
     # native build
     dependencies = [
         dependency('libavformat', version: '>= 57.33'),
         dependency('libavcodec', version: '>= 57.37'),
         dependency('libavutil'),
-        dependency('sdl2', version: '>= 2.0.5'),
+        sdldep
     ]

     if v4l2_support
@@ -216,7 +219,7 @@ conf.set('HAVE_USB', usb_support)

 configure_file(configuration: conf, output: 'config.h')

-src_dir = include_directories('src')
+src_dir = include_directories('src', sdldep_include)

 executable('scrcpy', src,
            dependencies: dependencies,
prife commented 11 months ago
git checkout IOS

编译

brew install meson  
meson x --buildtype=release --strip -Db_lto=true     

ninja -Cx

运行

tidevice relay 21343 21343
tidevice relay 21344 21344

./x/app/scrcpy -A --serial 00008110-000A210C1411801E