# Copyright (c) 2026 Dominic Masters
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT

# Sources
target_sources(${DUSK_LIBRARY_TARGET_NAME}
  PUBLIC
    audiolinux.c
    audiostreamlinux.c
)

# No hardware MP3 decoder on Linux - use the shared minimp3-based software
# backend (also used by Dolphin), sourced directly from src/dusk/audio
# rather than through its own unconditional CMakeLists.txt so platforms
# with a hardware decoder (PSP) never pull minimp3 in at all.
if(NOT minimp3_FOUND)
  find_package(minimp3 REQUIRED)
endif()
target_link_libraries(${DUSK_LIBRARY_TARGET_NAME} PUBLIC minimp3)
target_sources(${DUSK_LIBRARY_TARGET_NAME}
  PUBLIC
    "${DUSK_SOURCES_DIR}/dusk/audio/audiostreammp3decodersw.c"
)
