您的位置:首页 > 移动开发 > IOS开发

Cross compile webrtc for ios on mac os.

2013-11-06 23:07 465 查看
编译步骤

下载depot_tools

svn co http://src.chromium.org/svn/trunk/tools/depot_tools
设置PATH变量

export PATH=$PATH:`pwd`/depot_tools

设置代码路径

gclient config http://webrtc.googlecode.com/svn/trunk
设置项目组织方式为xcode

export GYP_GENERATORS="xcode"

开始同步代码

gclient sync --nohooks

gclient runhook --force

生成支持ios的项目文件

./build/gyp_chromium --depth=. -DOS=ios -Dtarget_arch=arm -Dinclude_tests=0 -Denable_protobuf=0 -Denable_video=1 webrtc/webrtc.gyp

gclient runhook 后遇到的问题

bogon:trunk probestar$ ./build/gyp_chromium --depth=. -DOS=ios -Dtarget_arch=arm -Dinclude_tests=0 -Denable_protobuf=0 -Denable_video=1 webrtc/webrtc.gyp
Updating projects from gyp files...
Traceback (most recent call last):
File "./build/gyp_chromium", line 161, in <module>
sys.exit(gyp.main(args))
File "/Users/probestar/Documents/WorkSpace/webrtc/trunk/tools/gyp/pylib/gyp/__init__.py", line 527, in main
return gyp_main(args)
File "/Users/probestar/Documents/WorkSpace/webrtc/trunk/tools/gyp/pylib/gyp/__init__.py", line 512, in gyp_main
generator.GenerateOutput(flat_list, targets, data, params)
File "/Users/probestar/Documents/WorkSpace/webrtc/trunk/tools/gyp/pylib/gyp/generator/ninja.py", line 2133, in GenerateOutput
pool.map(CallGenerateOutputForConfig, arglists)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/pool.py", line 225, in map
return self.map_async(func, iterable, chunksize).get()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/pool.py", line 522, in get
raise self._value
AssertionError: Multiple codesigning identities for identity: iPhone Developer

多个iPhone Developer证书,在Mac OS中的钥匙串中删除多余的证书即可。

报错

Traceback (most recent call last):
File "trunk/build/gyp_chromium", line 148, in <module>
not 'OS=ios' in os.environ.get('GYP_DEFINES'):
TypeError: argument of type 'NoneType' is not iterable
Error: Command /usr/bin/python trunk/build/gyp_chromium --depth=trunk trunk/all.gyp -Dextra_gyp_flag=0 returned non-zero exit status 1 in /Users/probestar/Documents/WorkSpace/webrtc

没有做环境配置

export GYP_DEFINES="$GYP_DEFINES OS=ios target_arch=armv7"
export GYP_GENERATOR_FLAGS="$GYP_GENERATOR_FLAGS output_dir=out_ios"
export GYP_CROSSCOMPILE=1
cd trunk
export GYP_DEFINES="build_with_libjingle=1 build_with_chromium=0 libjingle_objc=1"
export GYP_GENERATORS="xcode"

gclient runhook -- force

没有生成项目文件

缺少环境配置,默认生成ninja的项目

export GYP_GENERATORS="xcode"

gclient runhook 阶段报错

Updating projects from gyp files...
gyp: trunk/third_party/libsrtp/libsrtp.gyp not found (cwd: /Users/probestar/Documents/WorkSpace/webrtc)
Error: Command /usr/bin/python trunk/build/gyp_chromium --depth=trunk trunk/all.gyp -Dextra_gyp_flag=0 returned non-zero exit status 1 in /Users/probestar/Documents/WorkSpace/webrtc

缺少文件,删除.gclient中的target_os一行,重新gclient sync即可
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: