该问题慢慢解决中记录下:
1:下载源码
https://github.com/warmcat/libwebsockets/tree/v4.2-stable
2:分别执行命令
mkdir build destdir
- cd build
- export 'SAI_CPACK=-G ZIP'
- SAI_CPACK='-G ZIP'
- cmake .. -DCMAKE_MAKE_PROGRAM=/usr/bin/make -DCMAKE_IOS_DEVELOPER_ROOT=/opt/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer -DCMAKE_TOOLCHAIN_FILE=contrib/iOS.cmake -DIOS_PLATFORM=OS -DLWS_WITH_SSL=OFF
3: 假如项目使用SSL 则 -DLWS_WITH_SSL=ON
但是还需要指定OPENSSL的编译路径
命令如下
cmake .. -DCMAKE_MAKE_PROGRAM=/usr/bin/make -DCMAKE_IOS_DEVELOPER_ROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer -DCMAKE_TOOLCHAIN_FILE=contrib/iOS.cmake -DIOS_PLATFORM=OS -DLWS_WITH_SSL=ON -DLWS_OPENSSL_INCLUDE_DIRS=/Users/fei/libwebstable/openssl/include/ -DLWS_OPENSSL_LIBRARIES=‘/Users/fei/libwebstable/openssl/lib/libssl.a ; /Users/fei/libwebstable/openssl/lib/libcrypto.a’
最后执行 make -j
⚠️:以上的命令,必须是英文然后DLWS_OPENSSL_LIBRARIES这个路径‘;’是英文前后没有空格
网友评论