如何获得在iOS中支持armv7和arm64的webRTC库?
最佳答案
你很幸运。我刚刚完成将webrtc集成到我的项目中的几天。我的解决方案如下:
libtool -static -o src/out_ios_armv7/Release-iphoneos/libWebRTC-temp.a src/out_ios_armv7/Release-iphoneos/*。a
条-S -x -o src/out_ios_armv7/Release-iphoneos/libWebRTC-armv7.a -r src/out_ios_armv7/Release-iphoneos/libWebRTC-temp.a
libtool -static -o src/out_ios/Release-iphoneos/libWebRTC-temp.a src/out_ios/Release-iphoneos/*。a
条-S -x -o src/out_ios/Release-iphoneos/libWebRTC-arm64.a -r src/out_ios/Release-iphoneos/libWebRTC-temp.a
lipo-创建src/out_ios_armv7/Release-iphoneos/libWebRTC-armv7.a src/out_ios/Release-iphoneos/libWebRTC-arm64.a-输出libWebRTC.a
附:只需将您的armv7库构建为使用arm64分隔的文件夹:
export GYP_GENERATORS="ninja"
export GYP_DEFINES="build_with_libjingle=1 build_with_chromium=0 libjingle_objc=1 OS=ios target_arch=armv7"
export GYP_GENERATOR_FLAGS="$GYP_GENERATOR_FLAGS output_dir=out_ios_armv7"
export GYP_CROSSCOMPILE=1
pushd src
gclient runhooks
ninja -C out_ios_armv7/Release-iphoneos AppRTCDemo
popd