我一直在尝试按照 Google 在http://www.webrtc.org/native-code/ios(和相关链接)上的指示为 iOS 构建 webrtc。虽然我记得过去通过类似的步骤我已经能够构建它,但情况已不再如此。
这是我做的步骤:
下载先决条件:
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
$ export PATH=`pwd`/depot_tools:"$PATH"
下载回购:
$ 出口 GYP_DEFINES="OS=ios"
$ 获取 webrtc_ios
准备构建:
$ cd webrtc/src
$ export GYP_DEFINES="build_with_libjingle=1 build_with_chromium=0 libjingle_objc=1"
$ export GYP_DEFINES="$GYP_DEFINES OS=ios target_arch=armv7"
$ 出口 GYP_GENERATOR_FLAGS="output_dir=out_ios"
$ 出口 GYP_CROSSCOMPILE=1
$ gclient 运行钩子
建造:
$ ninja -C out_ios/Debug-iphoneos AppRTCDemo
一切都很好,直到最后一个命令失败并显示/bin/sh:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc:没有这样的文件或目录:
ninja: Entering directory `out_ios/Debug-iphoneos'
[3/1664] CC obj/chromium/src/third_party/boringssl/src/crypto/bio/boringssl.bio_mem.o
FAILED: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc -MMD -MF obj/chromium/src/third_party/boringssl/src/crypto/bio/boringssl.bio_mem.o.d -DV8_DEPRECATION_WARNINGS -DCLD_VERSION=2 -DDISABLE_NACL -DCHROMIUM_BUILD -DCR_CLANG_REVISION=247874-1 -DUSE_LIBJPEG_TURBO=1 -DENABLE_CONFIGURATION_POLICY -DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE -DDONT_EMBED_BUILD_METADATA -DFIELDTRIAL_TESTING_ENABLED -DDISABLE_FTP_SUPPORT=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DBORINGSSL_IMPLEMENTATION -DBORINGSSL_NO_STATIC_INITIALIZER -DOPENSSL_NO_ASM -DUSE_LIBPCI=1 -DUSE_OPENSSL=1 -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -Igen -I../../chromium/src/third_party/boringssl/src/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk -O0 -gdwarf-2 -fvisibility=hidden -Wnewline-eof -miphoneos-version-min=7.0 -arch arm64 -Wendif-labels -Wno-unused-parameter -Wno-missing-field-initializers -Wno-selector-type-mismatch -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wno-bitfield-width -Wno-unused-function -Wno-unused-variable -m32 -arch i386 -pipe -no-cpp-precomp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/usr/include/ -m32 -arch i386 -pipe -no-cpp-precomp -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/usr/include/ -std=c99 -Xclang -load -Xclang /Volumes/store/code/webrtc/src/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib -Xclang -add-plugin -Xclang find-bad-constructs -fcolor-diagnostics -fstack-protector-all -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -c ../../chromium/src/third_party/boringssl/src/crypto/bio/bio_mem.c -o obj/chromium/src/third_party/boringssl/src/crypto/bio/boringssl.bio_mem.o
/bin/sh: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc: No such file or directory
出于某种原因,忍者认为我们正在为模拟器构建,而且即使我们这样做也不是获得 gcc 的正确途径。请注意,我的系统安装了 XCode 7。
任何想法可能有什么问题或我该如何解决这个问题?
最好的问候, 安东尼斯