devopvoid / webrtc-java

WebRTC for desktop platforms running Java
Apache License 2.0
248 stars 60 forks source link

Add a build support for mac/aarch64 #109

Closed stevebriskin closed 1 year ago

stevebriskin commented 1 year ago

Tested on my M1 macbook, where "Tested" means it built and tests passed. I don't have access to a windows or x64 macos environment.

CMAKE_SYSTEM_PROCESSOR on macos will be the same as uname -m which is arm64 or or x86_64.

mac/aarch64 build output.

Note: I wasn't sure which way to proceed to set the TARGET_CPU in the cmake build files (I don't know cmake). I chose to do it in the cmake file rather than passing `-Aarm64' from maven. Primary reason being, "cmake -A" isn't supported in unix environments with the default "Unix Makefiles" generator. Here is the alternative where this logic is in maven. See diff.

Additionally, I'm not sure if the current Windows profile in webrtc-jni's pom.xml works, as the quotes around {cmake.options} are passed to cmake command (e.g. ....cmake "-Ax64" .... instead of ...cmake -Ax64 ...) and on my mac the -A option with quotes is ignored. Removing quotes (and pre-defining cmake.options) fixes this on my mac. Worth doublechecking intended behavior on Windows.

devopvoid commented 1 year ago

Great and thank you!

The current Windows profile in webrtc-jni's pom.xml works.

devopvoid commented 1 year ago

Now we need macarm64 CI cross-compilation. I'll add one the next weeks.

stevebriskin commented 1 year ago

I'm puzzled as to why mac x86 builds are failing. i'll debug. you may have to approve more workflow runs.

devopvoid commented 1 year ago

Does my commit work on your M1 machine?

stevebriskin commented 1 year ago

Does my commit work on your M1 machine? It does