Skip to content

Commit ccf56f1

Browse files
committed
cmake: Workaround for upstream flac-config.cmake not creating Threads::Threads
Upstream issue: xiph/flac#820
1 parent aed3aed commit ccf56f1

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,12 @@ if(SDLMIXER_FLAC_LIBFLAC)
578578
if(NOT SDLMIXER_FLAC_LIBFLAC_SHARED)
579579
list(APPEND PC_REQUIRES flac)
580580
endif()
581+
# Xiph's CMake script does not handle Threads::Threads correctly:
582+
# https://github.com/xiph/flac/issues/820
583+
get_property(flac_interface_link_libraries TARGET FLAC::FLAC PROPERTY INTERFACE_LINK_LIBRARIES)
584+
if(Threads::Threads IN_LIST flac_interface_link_libraries)
585+
find_package(Threads)
586+
endif()
581587
else()
582588
message(${fatal_error} "libflac NOT found")
583589
endif()

cmake/SDL3_mixerConfig.cmake.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL3_mixer-static-targets.cmake")
7474

7575
if(SDLMIXER_FLAC_LIBFLAC AND NOT TARGET FLAC::FLAC)
7676
find_dependency(FLAC)
77+
# Xiph's CMake script does not handle Threads::Threads correctly:
78+
# https://github.com/xiph/flac/issues/820
79+
get_property(flac_interface_link_libraries TARGET FLAC::FLAC PROPERTY INTERFACE_LINK_LIBRARIES)
80+
if(Threads::Threads IN_LIST flac_interface_link_libraries)
81+
find_package(Threads)
82+
endif()
7783
endif()
7884

7985
if(SDLMIXER_MOD_XMP AND NOT TARGET libxmp::libxmp)

0 commit comments

Comments
 (0)