PortAudio / portaudio

PortAudio is a cross-platform, open-source C language library for real-time audio input and output.
Other
1.43k stars 296 forks source link

Don't link to macOS frameworks with an absolute path #828

Closed daschuer closed 1 year ago

daschuer commented 1 year ago

Describe the bug Portaudio links to macOS framework with an absolute path. This breaks dynamic linked builds by updating Xcode.

To Reproduce Build Portaudio on macOS and look at the PortAudioTargets.cmake file:

set_target_properties(PortAudio::PortAudio PROPERTIES
  INTERFACE_COMPILE_DEFINITIONS "PA_USE_JACK=1;PA_USE_COREAUDIO=1"
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
  INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:Threads::Threads>;\$<LINK_ONLY:JACK::jack>;\$<LINK_ONLY:m>;/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreAudio.framework;/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/AudioToolbox.framework;/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/AudioUnit.framework;/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreFoundation.framework;/Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/CoreServices.framework"
)

Expected behavior instead macOS framework shall be linked with the -framework option

Actual behavior Building is broken after updating Xcode. A Rebuild of portaudio is required.

Desktop (please complete the following information):

Additional context Here is a GitHub workflow that demonstrates the issue: https://github.com/daschuer/mixxx/actions/runs/5688916805 Here is a fixed workflow with a patched Portaudio: https://github.com/daschuer/mixxx/actions/runs/5702341115 Note: The Ubuntu builds do not support CMake config mode and fails in any case.

I will prepare a patch soon.