Cross compile webrtc for ios on mac os.


編譯步驟

下載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即可

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM