| Summary: | [patch] Not using CoreAudio on OS X when built via CMake | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Felix H. Dahlke <fhd> |
| Component: | build | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | fhd, icculus |
| Version: | 2.0.3 | ||
| Hardware: | x86 | ||
| OS: | Mac OS X 10.8 | ||
| Attachments: | Patch that defines SDL_AUDIO_DRIVER_COREAUDIO | ||
Sorry, just realised this should probably be in the build component, changed that. Also, I've investigated this a bit. Looking at the output of both ./configure and cmake, it seems that CoreAudio is detected and used in both cases just fine. I'll gladly help debug this, but I think I need some pointers, I'm not overly confident with CMake, let alone autotools. Created attachment 1992 [details]
Patch that defines SDL_AUDIO_DRIVER_COREAUDIO
Alright, dug into this and attached a patch that seems to do the trick.
Possible follow-up: I think the MACOSX_COREAUDIO define should go away. It's only used in src/audio/coreaudio/SDL_coreaudio.c, and looking at the other drivers, that one should probably use SDL_AUDIO_DRIVER_COREAUDIO instead.
(In reply to Felix H. Dahlke from comment #2) > Alright, dug into this and attached a patch that seems to do the trick. This is now https://hg.libsdl.org/SDL/rev/705bdbbb1f37, thanks! > Possible follow-up: I think the MACOSX_COREAUDIO define should go away. It's > only used in src/audio/coreaudio/SDL_coreaudio.c, and looking at the other > drivers, that one should probably use SDL_AUDIO_DRIVER_COREAUDIO instead. CoreAudio is available on iOS but doesn't have the pieces of the API that are masked off by that #define. I'm not sure why the CMake file tries to set it, that doesn't actually become a #define anyhow in that case. I've removed it here: https://hg.libsdl.org/SDL/rev/6f04557c6e1f Thanks! --ryan. |
Steps to reproduce ------------------ 1. Build SDL 2.0.3 using CMake: mkdir build cd build cmake .. make 2. Link any SDL app doing `SDL_Init(SDL_INIT_AUDIO)` against the resulting libSDL2.a 3. Run the app What happens ------------ SDL_Init() fails, SDL_GetError() returns: "No available audio device" What should happen instead -------------------------- It should just work, as it does when calling SDL_Init() without SDL_INIT_AUDIO.