Enabling bitcode for WebRTC iOS

Viewed 468

Im having trouble enabling bitcode for webrtc framework ios and running out of ideas. I followed the instructions from their website but im getting error running python build_ios_libs.py --bitcode This is one part of error

../../stats/rtc_stats.cc:30:17: error: loop variable 'element' is always a copy because the range of type 'const std::vector<bool>' does not return a reference [-Werror,-Wrange-loop-analysis] for (const T& element : vector)

If anyone made bitcode enable work for webrtc ios, kindly help me thanks

3 Answers

You can either wait or fix it yourself!

According to this thread: What is clang's 'range-loop-analysis' diagnostic about?

it is enough to remove the "&" sign from each line that has the problem (the objects are not references anyway in that context and this causes the warning which kills the compilation). So for example:

for (const T& element : vector) {

becomes:

for (const T element : vector) {

Rinse and repeat for all the files the compiler complains about (there are just a few).

To save you time. If you're building using, for example:

tools_webrtc/ios/build_ios_libs.py --bitcode --arch arm64 x64

edit these files at line 30 and line 40, respectively and remove the & (ampersand sign) in the for-loops:

stats/rtc_stats.cc:30:8:

sdk/objc/api/peerconnection/RTCStatisticsReport.mm:40:14:

Related