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

# libmad-based MP3 decode, shared by every platform that doesn't have (or
# use) a hardware MP3 decoder - currently Linux/knulli and Dolphin
# (Wii/GameCube), both via the same software decoder and background
# decode-ahead ring (audiostreammp3decodersw.c, audiostreammp3ring.c). See
# src/CMakeLists.txt for which DUSK_TARGET_SYSTEM values pull this
# directory in at all - PSP uses its own hardware sceMp3 decoder instead
# (src/duskpsp/audio/audiostreammp3decoder.c) and never references
# anything here.
#
# Note: libmad is GPL-licensed, unlike the rest of this project - see
# audiostreammp3decodersw.h's own comment. Linking/finding libmad itself
# stays with each platform's own audio CMakeLists.txt (src/dusklinux/audio,
# cmake/targets/dolphin.cmake) rather than living here, since Linux and
# Dolphin genuinely obtain it differently (find_package() vs the bundled
# devkitPPC/libogc toolchain copy) - this file only owns the shared source.

# Includes
target_include_directories(${DUSK_LIBRARY_TARGET_NAME}
  PUBLIC
    ${CMAKE_CURRENT_LIST_DIR}
)

# Sources
target_sources(${DUSK_LIBRARY_TARGET_NAME}
  PUBLIC
    audiostreammp3decodersw.c
    audiostreammp3ring.c
)
