owt native ios sdk 构建

owt native ios sdk

windows 的构建有些问题,回公司再看
我的macbook 256g的,勉为其难的构建一番ios的把
之前下周了webrtc,至少消耗了20g, 现在owt 也会下webrtc
不知道够不够用

  • 在路径 ~/tet/webrtc_build/owt-native/src 下面
  • 新建一个 .glient 文件,写入owt native 的git仓库地址

执行gclient sync

  • 自动下载 owt native 仓库
  • 自动下载需要的其他仓库
  • 成功
[4:48:25]   src/third_party/webrtc

[4:48:35] Still working on:
[4:48:35]   src/third_party/webrtc

[4:48:45] Still working on:
[4:48:45]   src/third_party/webrtc

[4:48:55] Still working on:
[4:48:55]   src/third_party/webrtc

[4:48:59] Still working on:
[4:48:59]   src/third_party/webrtc
Syncing projects: 100% (32/32), done.                
Running hooks:  43% (10/23) mac_toolchain                 
________ running 'vpython src/build/mac_toolchain.py' in '/Users/zhangbin/tet/webrtc_build/owt-native/src'
Skipping Mac toolchain installation for mac
Running hooks:  52% (12/23) clang        
________ running 'vpython src/tools/clang/scripts/update.py' in '/Users/zhangbin/tet/webrtc_build/owt-native/src'
Downloading https://commondatastorage.googleapis.com/chromium-browser-clang/Mac/clang-373424-64a362e7-1.tgz .......... Done.
Hook 'vpython src/tools/clang/scripts/update.py' took 82.84 secs
Running hooks:  65% (15/23) clang_format_mac
________ running 'download_from_google_storage --no_resume --platform=darwin --no_auth --bucket chromium-clang-format -s src/buildtools/mac/clang-format.sha1' in '/Users/zhangbin/tet/webrtc_build/owt-native/src'
0> Downloading src/buildtools/mac/clang-format...
Downloading 1 files took 49.783704 second(s)
Hook 'download_from_google_storage --no_resume --platform=darwin --no_auth --bucket chromium-clang-format -s src/buildtools/mac/clang-format.sha1' took 49.89 secs
Running hooks:  95% (22/23)                     
Hook 'download_from_google_storage --directory --recursive --num_threads=10 --no_auth --quiet --bucket chromium-webrtc-resources src/third_party/webrtc/resources' took 4309.82 secs
Running hooks: 100% (23/23) 
________ running 'vpython src/scripts/prepare_dev.py' in '/Users/zhangbin/tet/webrtc_build/owt-native/src'
Applying: Use OpenSSL for usrsctp
Applying: Use OpenSSL for libsrtp.
Applying: Remove webrtc_overrides
Applying: Fixed compile issue and disable thin archive for Linux
Applying: Fix examples path error.
Applying: Export WebRTC symbols on iOS.
Applying: Apply libjpeg_turbo fix for CVE-2018-20330 & CVE-2018-19664
Running hooks: 100% (23/23), done.
 zhangbin@pb6a80114  ~/tet/webrtc_build/owt-native/src   master  

构建 ios版本

  • 注意路径,我在src目录下做gclient sync, 下载到src目录
  • 所以owt native的代码在src/src 下
  • 在这个路径 执行python脚本
  • 这样就可以去src/src/build/下加载各种python脚本
 -  zhangbin@pb6a80114  ~/tet/webrtc_build/owt-native/src/src  ➦ e983dc8  python scripts/build.py
Done. Made 1471 targets from 225 files in 5226ms
ninja: Entering directory `out/Debug-device-arm64'
[130/2754] CC obj/third_party/opus/opus/debu

默认构建所有版本的ios库

https://github.com/open-webrtc-toolkit/owt-client-native.

You can refer to the readme doc to build it or follow bellow steps. 

1. install depot_tools and add it to path

2. build OpenSSL 1.1.0l or higher

3. clone the source code to src dir

4. Create file named .gclient under the same directory of src dir, with below contents:

solutions = [
  {
    "managed": False,
    "name": "src",
    "url": "https://github.com/open-webrtc-toolkit/owt-client-native.git",
    "custom_deps": {},
    "deps_file": "DEPS",
    "safesync_url": "",
  },
]
target_os = ["mac", "ios"]

5. run "gclient sync" command in src dir

6. run build script "python scripts/build.py --arch x64,arm,arm64 --skip_tests --ssl_root ~/Documents/OpenSSL-for-iPhone --scheme release" in src dir

 

模拟器版本

 zhangbin@pb6a80114  ~/tet/webrtc_build/owt-native/src/src  ➦ e983dc8  python scripts/build.py
Done. Made 1471 targets from 225 files in 5226ms
ninja: Entering directory `out/Debug-device-arm64'
[2754/2754] LIBTOOL-STATIC obj/talk/owt/libowt_sdk_base.a
ninja: Entering directory `out/Debug-device-arm64'
[7/7] LIBTOOL-STATIC obj/talk/owt/libowt_sdk_p2p.a
ninja: Entering directory `out/Debug-device-arm64'
[8/8] LIBTOOL-STATIC obj/talk/owt/libowt_sdk_conf.a
ninja: Entering directory `out/Debug-device-arm64'
[36/36] LIBTOOL-STATIC obj/talk/owt/libowt_sdk_objc.a
ninja: Entering directory `out/Debug-device-arm64'
[1/1] LIBTOOL-STATIC obj/talk/owt/libowt_deps.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (audio_receive_stream.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(audio_receive_stream.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(audio_receive_stream.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (audio_send_stream.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(audio_send_stream.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(audio_send_stream.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (audio_state.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(audio_state.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(audio_state.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (auto_correlation.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(auto_correlation.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(auto_correlation.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (base64.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(base64.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(base64.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (convert.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(convert.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(convert.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (cross_correlation.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(cross_correlation.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(cross_correlation.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (decoder_database.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(decoder_database.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(decoder_database.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (dtls_transport.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(dtls_transport.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(dtls_transport.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (encoded_frame.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(encoded_frame.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(encoded_frame.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (err.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(err.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(err.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (helpers.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(helpers.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(helpers.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (histogram.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(histogram.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(histogram.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (int128.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(int128.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(int128.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (jsep_ice_candidate.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(jsep_ice_candidate.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(jsep_ice_candidate.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (logging.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_sdk_base.a(logging.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(logging.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (moving_average.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(moving_average.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(moving_average.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (packet.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(packet.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(packet.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (packet_buffer.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(packet_buffer.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(packet_buffer.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (rtp_sender.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(rtp_sender.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(rtp_sender.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (sctp_transport.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(sctp_transport.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(sctp_transport.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (socket.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(socket.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(socket.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (splitting_filter.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(splitting_filter.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(splitting_filter.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (stream.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_sdk_base.a(stream.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(stream.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (sysinfo.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(sysinfo.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_sdk_base.a(sysinfo.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (thread.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(thread.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(thread.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (video_common.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(video_common.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(video_common.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (video_frame_buffer.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(video_frame_buffer.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(video_frame_buffer.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (video_receive_stream.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(video_receive_stream.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(video_receive_stream.o) due to use of basename, truncation and blank padding
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: warning same member name (video_send_stream.o) in output file used for input files: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(video_send_stream.o) and: out/Debug-device-arm64/obj/talk/owt/libowt_deps.a(video_send_stream.o) due to use of basename, truncation and blank padding
Done. Made 1509 targets from 227 files in 5366ms
Start running unit tests.
ninja: Entering directory `out/Debug-simulator-x64'
[1680/2918] CXX clang_x64/obj/buildtools/third_party/libc++/libc++/de

issue里有人遇到类似问题

  • https://github.com/open-webrtc-toolkit/owt-client-native/issues/303
Hi,

I'm really struggeling getting OWT running for iOS. I've tried building different branches and so on.

Environment:
OpenSSL version: 1.1.1d Sep 2019
gclient version: gclient.py 0.7
MacOS version: 10.15.2 Catalina
Xcode Version: 11.3.1 (11C504)
iOS test device: iPhone 7 @ iOS 13.3
Python version: 2.7.16

General
Tests fail due to sdk_info.FillXcodeVersion(settings) now requires 2 arguments. For all tests I've added None as the second parameter.

Branch master

Builds fine and tests pass.

Compile error in XCode after importing WebRTC/OWT.framework into a xcode ios project using conferencing:

XCode output
Branch 76

Compile error in XCode after importing WebRTC/OWT.framework into a xcode ios project using conferencing:

XCode output
Branch 79

Compiles, but tests fail.

Console output
Using the lib in a conferencing project results in runtime exception:

XCode output
Branch 79 (with modified .gclient file)

Changed url in .gclient to "url": "https://github.com/open-webrtc-toolkit/owt-client-native.git@origin/79" just to see if it makes a difference.

Testing failed:

Console output error only
Console output full
Using the lib anyway results in runtime error:

XCode output
Branch 4.1.x

Error during gclient sync

Console output full
Branch 4.2.x

Error during gclient sync

Console output full
Please advice, thank you.

ios demo

  • 这个issue 提到要构建 sioclient.a
  • 还需要自己构建openssl么?
With the new built libcrypto.a, libssl.a, it works.
https://github.com/x2on/OpenSSL-for-iPhone
./build-libssl.sh --version=1.1.0f --deprecated
  • demo 老说我是arm64的owt库

编译模拟器版本的

  • 根据arch默认的arm64 的,模拟器需要自己重新编译
parser.add_argument('--arch', default='arm64', dest='target_arch',
      help='Target architectures. Could be multiple values seperated by comma.')
  • 先编译一个openssl的模拟器版本?
 zhangbin@pb6a80114  ~/tet/webrtc_build/owt-native/OpenSSL-for-iPhone   master  ./build-libssl.sh 

Build options
  OpenSSL version: 1.1.1d
  Targets: ios-sim-cross-x86_64 ios64-cross-arm64 ios64-cross-arm64e tvos-sim-cross-x86_64 tvos64-cross-arm64
  iOS SDK: 13.2
  tvOS SDK: 13.2
  Number of make threads: 8
  Configure options:  no-deprecated
  Build location: /Users/zhangbin/tet/webrtc_build/owt-native/OpenSSL-for-iPhone

Downloading openssl-1.1.1d.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 8638k  100 8638k    0     0   360k      0  0:00:23  0:00:23 --:--:--  347k
Building openssl-1.1.1d for iPhoneSimulator 13.2 x86_64...
  Logfile: /Users/zhangbin/tet/webrtc_build/owt-native/OpenSSL-for-iPhone/bin/iPhoneSimulator13.2-x86_64.sdk/build-openssl-1.1.1d.log
  Configure...
  Make (using 8 thread(s))...
Building openssl-1.1.1d for iPhoneOS 13.2 arm64...
  Logfile: /Users/zhangbin/tet/webrtc_build/owt-native/OpenSSL-for-iPhone/bin/iPhoneOS13.2-arm64.sdk/build-openssl-1.1.1d.log
  Configure...
  Make (using 8 thread(s))...
Building openssl-1.1.1d for iPhoneOS 13.2 arm64e...
  Logfile: /Users/zhangbin/tet/webrtc_build/owt-native/OpenSSL-for-iPhone/bin/iPhoneOS13.2-arm64e.sdk/build-openssl-1.1.1d.log
  Configure...
  Make (using 8 thread(s))...
Building openssl-1.1.1d for AppleTVSimulator 13.2 x86_64...
  Logfile: /Users/zhangbin/tet/webrtc_build/owt-native/OpenSSL-for-iPhone/bin/AppleTVSimulator13.2-x86_64.sdk/build-openssl-1.1.1d.log
  Configure...
  Make (using 8 thread(s))...
Building openssl-1.1.1d for AppleTVOS 13.2 arm64...
  Logfile: /Users/zhangbin/tet/webrtc_build/owt-native/OpenSSL-for-iPhone/bin/AppleTVOS13.2-arm64.sdk/build-openssl-1.1.1d.log
  Configure...
  Make (using 8 thread(s))...
Build library for iOS...

=====>iOS SSL and Crypto lib files:
/Users/zhangbin/tet/webrtc_build/owt-native/OpenSSL-for-iPhone/lib/libssl.a
/Users/zhangbin/tet/webrtc_build/owt-native/OpenSSL-for-iPhone/lib/libcrypto.a
Build library for tvOS...

=====>tvOS SSL and Crypto lib files:
/Users/zhangbin/tet/webrtc_build/owt-native/OpenSSL-for-iPhone/lib/libssl-tvOS.a
/Users/zhangbin/tet/webrtc_build/owt-native/OpenSSL-for-iPhone/lib/libcrypto-tvOS.a

=====>Include directory:
/Users/zhangbin/tet/webrtc_build/owt-native/OpenSSL-for-iPhone/include/
Done.
 zhangbin@pb6a80114  ~/tet/webrtc_build/owt-native/OpenSSL-for-iPhone   master  

  • 模拟器
  • 很给力啊
  • 支持的体系结构有 arm arm64 x86 x64
ARCH_PARAM_DICT = {'arm':'device-arm32', 'arm64':'device-arm64',
    'x86':'simulator-x86','x64':'simulator-x64'}
python scripts/build.py --arch 'x64'  --ssl_root '/Users/zhangbin/tet/webrtc_build/owt-native/OpenSSL-for-iPhone/bin/iPhoneSimulator13.2-x86_64.sdk' --scheme 'release'
发布了664 篇原创文章 · 获赞 55 · 访问量 217万+

猜你喜欢

转载自blog.csdn.net/commshare/article/details/104094153