Skip to content

Commit

Permalink
Move pkg-config required FLAC dependency inside conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
alef committed Sep 30, 2023
1 parent 9f9773f commit 9e96cd4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CMakeModules/Find/FindSDL2_mixer.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,13 @@ endif()

if(PKG_CONFIG_FOUND)
message(STATUS "Searching for SDL_mixer deps libraries --")
pkg_check_modules(FLAC REQUIRED IMPORTED_TARGET flac)
if(TARGET SDL2_mixer::SDL2_mixer-static)
pkg_check_modules(FLAC REQUIRED IMPORTED_TARGET flac)
target_link_libraries(SDL2_mixer::SDL2_mixer-static INTERFACE
PkgConfig::FLAC
)
elseif(TARGET SDL2_mixer::SDL2_mixer)
pkg_check_modules(FLAC REQUIRED IMPORTED_TARGET flac)
target_link_libraries(SDL2_mixer::SDL2_mixer INTERFACE
PkgConfig::FLAC
)
Expand Down

0 comments on commit 9e96cd4

Please sign in to comment.