使用NDK和CMake为Android设备构建shadowsocks / badvpn

时间:2019-08-01 05:40:47

标签: android cmake android-ndk

我想为Android设备构建此仓库 https://github.com/shadowsocks/badvpn

我遵循 https://github.com/shadowsocks/badvpn#installation 并执行以下命令

cmake .. -DBUILD_NOTHING_BY_DEFAULT=1 -DBUILD_TUN2SOCKS=1 -DCMAKE_SYSTEM_NAME=Android
make install

我使用了CMAKE_SYSTEM_NAME标志来定位cmake文档中提到的android设备 https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-android

我正在使用从以下网站下载的NDK修订版18b(2019年1月) https://developer.android.com/ndk/downloads/older_releases.html

运行make install后,出现以下错误:

[ 42%] Building C object system/CMakeFiles/system.dir/BSignal.c.o
In file included from /home/smart/Downloads/badvpn/system/BSignal.c:34:
/home/smart/Downloads/badvpn/system/BUnixSignal.h:38:2: error: Unknown signal
      backend or too many signal backends
#error Unknown signal backend or too many signal backends
 ^
In file included from /home/smart/Downloads/badvpn/system/BSignal.c:34:
In file included from /home/smart/Downloads/badvpn/system/BUnixSignal.h:45:
In file included from /home/smart/Downloads/badvpn/system/BReactor.h:6:
/home/smart/Downloads/badvpn/system/BReactor_badvpn.h:39:2: error: Unknown event
      backend or too many event backends
#error Unknown event backend or too many event backends
 ^
2 errors generated.
make[2]: *** [system/CMakeFiles/system.dir/build.make:76: system/CMakeFiles/system.dir/BSignal.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:147: system/CMakeFiles/system.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

错误是:

  

未知事件后端或事件后端太多

0 个答案:

没有答案