-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FindPortAudio: Link ALSA in static builds on Linux #12291
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,6 +43,8 @@ The following cache variables may also be set: | |
|
||
#]=======================================================================] | ||
|
||
include(IsStaticLibrary) | ||
|
||
find_package(PkgConfig QUIET) | ||
if(PkgConfig_FOUND) | ||
pkg_check_modules(PC_PortAudio QUIET portaudio-2.0) | ||
|
@@ -89,6 +91,14 @@ if(PortAudio_FOUND) | |
) | ||
is_static_library(PortAudio_IS_STATIC PortAudio::PortAudio) | ||
if(PortAudio_IS_STATIC) | ||
if(PortAudio_ALSA_H) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should probably check if we need this, a few lines above the file states that this was a workaround to provide compile-time defines for checking whether ALSA exists, so we might not want to rely on Is it safe to simply link ALSA whenever we find it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we do not "link" it. We just tell the linker "Here is something that you may want to link". So you solution should be safe in any case. |
||
find_package(ALSA) | ||
if(ALSA_FOUND) | ||
set_property(TARGET PortAudio::PortAudio APPEND PROPERTY INTERFACE_LINK_LIBRARIES | ||
ALSA::ALSA | ||
) | ||
endif() | ||
endif() | ||
find_package(JACK) | ||
if(JACK_FOUND) | ||
set_property(TARGET PortAudio::PortAudio APPEND PROPERTY INTERFACE_LINK_LIBRARIES | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I've added this include to be explicit, we previously assumed that it was transitively included through one of the other
FindX
modules.