stasel / WebRTC

Unofficial distribution of up to date WebRTC framework binaries for iOS and macOS
Other
359 stars 76 forks source link

m1 mac support #3

Closed ruslandoga closed 3 years ago

ruslandoga commented 3 years ago

👋

I wonder if it would be possible to add arm64 cpu for Mac target to be able to use webrtc in simulators on m1 macs?

Thanks!

stasel commented 3 years ago

Hey, I currently don't have access to arm mac. The binary includes arm64 binaries for iOS, do they work on an arm mac simulator? What happens if you try to run simulator with the library? crash? error? or it falls back to rosetta?

ruslandoga commented 3 years ago

I get symbols not found for iOS-simulator arm64 error during compilation. I'll try building webrtc for mac target with arm64 arch to see if it works.

gn gen . --args='target_os="mac" target_cpu="arm64" ...
stasel commented 3 years ago

Thanks for the answer, macOS binary probably wont work on simulator regardless architecture.

I'm in the process of adding more binary variants to the xcframework, I'll try to add arm64 simulator as well

stasel commented 3 years ago

Hey Again, I think I made XCFramework file with arm64 simulator support. If you can confirm on your arm mac that it works that will be super helpful for me.

Download link: https://www.dropbox.com/s/8ao8k2gsfj0p2kh/WebRTC.xcframework.zip?dl=0

ruslandoga commented 3 years ago

@stasel Hi!

The build was successful (but I had to adapt to RTCPeerConnectionFactory.peerConnection returning an optional now). And audio calls worked fine as well (I don't have video calls in the app).

Thanks for the quick solution!

stasel commented 3 years ago

Awesome! Thanks a lot for testing this for me, I'm happy that it works. The peerconnection optional error was probably because I compiled the library from master so it must be a new change.

I'll release the full XCFramework later today / tomorrow for all of us to enjoy.

Cheers

stasel commented 3 years ago

Release M90 version with arm64 simulator support.

Thanks again for confirming the framework. Feel free to reopen the issue if you are still experiencing problems

isadon commented 2 years ago

@stasel Can you detail what changes were required to get arm64 simulator to build? I have a script that builds ios_x64, ios_arm64 and mac_x64 but not sure how to get an ios arm64 simulator build going. I try to generate the arm64 simulator build by specifying target_os =mac and target_cpu = arm64 but when the framework gets generated I get Both 'macos-arm64' and 'macos-x86_64' represent two equivalent library definitions.

stasel commented 2 years ago

If you are using xcodebuild -create-xcframework it will not work unfortunately. To solve this, I combined all binaries using lipo and manually created the xcframework. Check my build script for see the process

kismet- commented 2 years ago

If you are using xcodebuild -create-xcframework it will not work unfortunately. To solve this, I combined all binaries using lipo and manually created the xcframework. Check my build script for see the process

Where can I view your build script?