Skip to content

Commit

Permalink
Merge pull request #12291 from fwcd/linux-static-alsa
Browse files Browse the repository at this point in the history
FindPortAudio: Link ALSA in static builds on Linux
  • Loading branch information
daschuer authored Nov 12, 2023
2 parents e79bb66 + 9d54077 commit 81ba008
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmake/modules/FindPortAudio.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -89,6 +91,14 @@ if(PortAudio_FOUND)
)
is_static_library(PortAudio_IS_STATIC PortAudio::PortAudio)
if(PortAudio_IS_STATIC)
if(PortAudio_ALSA_H)
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
Expand Down

0 comments on commit 81ba008

Please sign in to comment.