-
-
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
Conversation
@@ -43,6 +43,8 @@ The following cache variables may also be set: | |||
|
|||
#]=======================================================================] | |||
|
|||
include(IsStaticLibrary) |
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.
@@ -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 comment
The 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 PortAudio_ALSA_H
.
Is it safe to simply link ALSA whenever we find it?
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.
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.
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.
LGTM
I think the PortAudio_ALSA_H can remain for completeness. |
Sounds good |
Is this a 2.4 PR? |
My gut feeling was to scope support for static linking on Linux to |
OK, so let's merge it to main. |
As a follow-up to #12284, this is another step towards making it possible to build Mixxx statically on Linux. In particular, we we missing a link dependency on ALSA, that resulted in these errors (see e.g. this build):
This is likely not the end of the story, there are some other libraries such as
libudev
that we'll have to take care of, but that's for another PR.