doorxp

Blog

#Cocos Creator# 编译 websock

ANDROID_NDK_HOME=/Users/doorxp/Library/Android/sdk/ndk/21.3.6528147
MYLIB='/Applications/CocosCreator/Creator/2.4.3/CocosCreator.app/Contents/Resources/cocos2d-x/external/android';
ABIS=('arm64-v8a' 'armeabi-v7a' 'x86_64' 'x86')
function gen() {
rm -rf CMakeCache.txt
rm -rf CMakeFiles
rm -rf cmake_install.cmake
rm -rf Makefile
rm -rf CTestTestfile.cmake
cmake -DDEBUG=NO -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake \
      -DANDROID_NDK=$ANDROID_NDK_HOME \
      -DANDROID_ABI=$1 \
      -DANDROID_TOOLCHAIN=clang \
      -DANDROID_PLATFORM=android-21 \
      -DANDROID_STL=c++_shared \
  -DLWS_WITHOUT_DAEMONIZE=ON \
      -DLWS_WITHOUT_TESTAPPS=ON \
      -DLWS_IPV6=ON \
      -DLWS_WITH_BUNDLED_ZLIB=OFF \
  -DLWS_WITH_SSL=ON  \
      -DLWS_WITH_HTTP2=ON \
-DLWS_OPENSSL_INCLUDE_DIRS="$MYLIB/$1/include" \
-DLWS_OPENSSL_LIBRARIES="$MYLIB/$1/libssl.a;$MYLIB/$1/libcrypto.a"
make
if [ -e "lib/libwebsockets.a" ]; then
mkdir -p out/$1/
mv lib/libwebsockets.a out/$1/libwebsockets.a
mv lib/libwebsockets.so out/$1/libwebsockets.so
fi
}
for abi in ${ABIS[@]}; do
gen $abi;
done


发表评论:

Powered By Z-BlogPHP 1.5.1 Zero

Copyright doorxp.com Rights Reserved.