Skip to content

Commit

Permalink
FindSndFile: Link FLAC in static builds
Browse files Browse the repository at this point in the history
  • Loading branch information
fwcd committed Apr 10, 2024
1 parent ada244c commit 2c75eb8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cmake/modules/FindSndFile.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_SndFile QUIET sndfile)
Expand Down Expand Up @@ -94,5 +96,14 @@ if(SndFile_FOUND)
INTERFACE_COMPILE_OPTIONS "${PC_SndFile_CFLAGS_OTHER}"
INTERFACE_INCLUDE_DIRECTORIES "${SndFile_INCLUDE_DIR}"
)
is_static_library(SndFile_IS_STATIC SndFile::sndfile)
if(SndFile_IS_STATIC)
find_package(FLAC)
if(FLAC_FOUND)
set_property(TARGET SndFile::sndfile APPEND PROPERTY INTERFACE_LINK_LIBRARIES
FLAC::FLAC
)
endif()
endif()
endif()
endif()

0 comments on commit 2c75eb8

Please sign in to comment.