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

# Only one save device implementation is ever compiled in - it must match
# whichever one savedeviceplatform.h dispatches to. In particular, the NAND
# (ISFS) device can't even compile on GameCube - libogc's isfs.h declares
# nothing at all outside of Wii (HW_RVL) builds.
if(DUSK_TARGET_SYSTEM STREQUAL "wii" AND DUSK_SAVE_WII_METHOD STREQUAL "NAND")
  target_sources(${DUSK_LIBRARY_TARGET_NAME}
    PUBLIC
      savedevicedolphinnand.c
  )
elseif(DUSK_TARGET_SYSTEM STREQUAL "wii" AND DUSK_SAVE_WII_METHOD STREQUAL "SD")
  target_sources(${DUSK_LIBRARY_TARGET_NAME}
    PUBLIC
      savedevicedolphinsd.c
  )
else()
  # GameCube, or Wii with DUSK_SAVE_WII_METHOD=CARD.
  target_sources(${DUSK_LIBRARY_TARGET_NAME}
    PUBLIC
      savedevicedolphincard.c
  )
endif()
