sound: use openal-soft instead of the frozen system OpenAL on macOS#3072
Open
tomjn wants to merge 1 commit into
Open
sound: use openal-soft instead of the frozen system OpenAL on macOS#3072tomjn wants to merge 1 commit into
tomjn wants to merge 1 commit into
Conversation
macOS' system OpenAL.framework is frozen at a pre-EFX version and does not
ship efx.h / alext.h, so find_package(OpenAL) selecting it makes the EFX
sound code fail to compile (and it would not work at runtime either):
fatal error: efx.h: No such file or directory
fatal error: alext.h: No such file or directory
Prefer openal-soft, which implements EFX. Homebrew installs it keg-only,
so it is not on the default search path and find_package would otherwise
keep picking the framework. On Apple, locate the keg via `brew --prefix
openal-soft`, prepend it to CMAKE_PREFIX_PATH, and set CMAKE_FIND_FRAMEWORK
to LAST so the openal-soft headers/library are found ahead of the system
framework. Falls back to the previous behaviour when brew/openal-soft are
unavailable.
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 free
to 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.
What
On macOS, steer
find_package(OpenAL)toward openal-soft instead of the systemOpenAL.framework.Why
macOS' system
OpenAL.frameworkis frozen at a pre-EFX version and does not shipefx.h/alext.h. Withfind_package(OpenAL)selecting it, the EFX sound code fails to compile (and would not work at runtime even if it did):openal-soft implements EFX, but Homebrew installs it keg-only, so it is not on the default search path and
find_packagekeeps picking the framework. OnAPPLE, this locates the keg viabrew --prefix openal-soft, prepends it toCMAKE_PREFIX_PATH, and setsCMAKE_FIND_FRAMEWORK LASTso openal-soft's headers/library are found ahead of the framework. It falls back to the previous behaviour when brew / openal-soft are unavailable.Requires
openal-softto be installed (brew install openal-soft).Testing
soundtarget on macOS failed on theefx.h/alext.hincludes shown above.openal-softinstalled):find_package(OpenAL)resolves to/opt/homebrew/opt/openal-soft(verified in the cache), and the OpenAL/EFX include errors are gone. Remaining build errors on plainmasterare unrelated, pre-existing macOS portability issues (FastMath circular include, MemPool thread-id cast) tracked separately; with those present thesoundtarget builds cleanly on macOS arm64 (Homebrew GCC 16). No change on non-Apple platforms.AI usage disclosure
Identified and drafted with AI assistance (Claude Code); reviewed and build-verified by a human.