# 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 - uses the shared libmad-based software
# backend + decode-ahead ring in src/duskmad instead (also used by
# Dolphin). See audiostreammp3decodersw.h's own comment on why libmad
# (GPL-licensed) replaced this project's original minimp3-based
# implementation. Linking stays here (rather than in src/duskmad itself)
# since Linux and Dolphin genuinely obtain libmad differently -
# find_package() here, the bundled devkitPPC/libogc toolchain copy there.
if(NOT libmad_FOUND)
  find_package(libmad REQUIRED)
endif()
target_link_libraries(${DUSK_LIBRARY_TARGET_NAME} PUBLIC libmad::mad)
