git clone --recursive https://github.com/mozilla/cubeb.git
cd cubeb/src
git clone https://github.com/mozilla/cubeb-coreaudio-rs.git
cd ../..
mkdir cubeb-build
cd cubeb-build
cmake ../cubeb -DBUILD_RUST_LIBS="ON"
cmake --build .
CUBEB_BACKEND="audiounit-rust" ctest
You have to add an empty [workspace] after the first build attempt to cubeb-sys/libcubeb/src/cubeb-coreaudio-rs/Cargo.toml because it needs be disconnected to the main workspace.
Then the libs get correctly build in cubeb-sys/libcubeb/src/cubeb-coreaudio-rs/target/release/libcubeb_coreaudio.a and cubeb-sys/libcubeb/src/cubeb-coreaudio-rs/target/debug/libcubeb_coreaudio.a where the CMake script of cubeb should be looking for it according to CMakeScript line 363.
note: Undefined symbols for architecture arm64:
"_audiounit_rust_init", referenced from:
_cubeb_init in libcubeb_sys-9e0ec07f36791a82.rlib(cubeb.c.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
As discussed with @padenot currently on macOS the rust libs don't get built. This is an attempt to download the rust libs and build them in build.rs according to: https://github.com/mozilla/cubeb-coreaudio-rs/blob/trailblazer/build-audiounit-rust-in-cubeb.sh
You have to add an empty
[workspace]
after the first build attempt tocubeb-sys/libcubeb/src/cubeb-coreaudio-rs/Cargo.toml
because it needs be disconnected to the main workspace.Then the libs get correctly build in
cubeb-sys/libcubeb/src/cubeb-coreaudio-rs/target/release/libcubeb_coreaudio.a
andcubeb-sys/libcubeb/src/cubeb-coreaudio-rs/target/debug/libcubeb_coreaudio.a
where the CMake script of cubeb should be looking for it according to CMakeScript line 363.The linking fails anyways with
Any ideas for a different strategy?