下载prebuilt server
ae74a81ea79c0dc7250e586627c278c0a9a8c5de46c9fb5c38c167fb1a36f056Download the prebuilt server somewhere, and specify its path during the Meson configuration:
meson x --buildtype=release --strip -Db_lto=true \
-Dprebuilt_server=[改为上面下载保存的文件]
ninja -Cx # DO NOT RUN AS ROOT
测试运行
./run x [options]
After a successful build, you can install scrcpy on the system:
sudo ninja -Cx install # without sudo on Windows
scrcpy 就能用了。
sudo ninja -Cx uninstall # without sudo on Windows

这里很明显是,头文件引用时路径错了,SDL2 在导入路径里有了,在头文件引用时也包含了,重复了,导致引入文件实际查找 xxxxxxx/SD2/SD2/xxxxxxx.h 了,将错就错,按上面路径
在 /opt/homebrew/include/SDL2 下再建个 SDL2目录 并文件都复制到 SDL2子目录里:
/opt/homebrew/include/SDL2/SDL2/*.h 就都能找到了。

这个错误也是和上面同理,把 /opt/homebrew/Cellar/libusb/1.0.24/include/libusb-1.0 多建一级子目录 /opt/homebrew/Cellar/libusb/1.0.24/include/libusb-1.0/libusb-1.0