Uh oh!
There was an error while loading. Please reload this page.
Build the engine on macOS - #3
Open
HungOm wants to merge 1 commit into
Open
Conversation
The crate did not compile for macOS. HwDriver, HwOptions, MidiHub and HwWorker are imported per target from a backend module -- alsa on Linux, oss on FreeBSD, sndio on OpenBSD, wasapi on Windows -- but the struct fields and signatures that use them are not gated, and macOS had no backend, so every reference was unresolved. discover_midi_hw_devices and hw_profile_backend_label likewise had an arm per target and no macOS arm, leaving their bindings undefined. Add hw::coreaudio as the macOS backend. Maolan has no native CoreAudio driver yet, so HwDriver::new_with_options reports that and points at JACK, which hw::jack already provides on any unix; MidiHub and HwOptions are the shared platform-neutral types the other backends re-export. workers:: coreaudio_worker instantiates the generic HwWorker over it. Also on macOS: - MidiInputWaiter's kqueue implementation is shared with FreeBSD and OpenBSD; macOS has the same kqueue interface, so it applies unchanged. - pthread_setname_np takes only the name and applies to the calling thread, unlike the Linux two-argument form and the BSD pthread_set_name_np. - MIDI endpoints come from CoreMIDI rather than device nodes, so hardware MIDI discovery returns nothing until a CoreMIDI backend exists. - hw::latency and hw::ports exist to support a native driver and have no consumer without one. Every change is either macOS-only or a cfg widened to include macOS, so no other target's build changes. Verified on macOS: clippy --all-targets -D warnings clean, and 344 tests pass with MAOLAN_PLUGIN_HOST pointing at a locally built plugin host. A Linux cross-check could not be run here: jack-sys needs pkg-config configured for cross-compilation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR: Add macOS hardware backend
Adds macOS backend support so the crate builds and runs on macOS.
Adds
hw::coreaudiowith a placeholderHwDriverthat directs users to JACK.Adds macOS
HwWorkerintegration and shared MIDI/options support.Enables existing kqueue and macOS pthread handling.
Adds required macOS
cfgcoverage for hardware MIDI, latency, and ports.Native CoreAudio/CoreMIDI support remains future work.
Verified: macOS Clippy clean and 344 tests passing.