# SPDX-License-Identifier: GPL-2.0-or-later
# SPDX-FileCopyrightText: Copyright (C) 2026 Max A. Vilkki a.k.a. codise
#
# hardsid_play: plays a .sid file on a HardSID 4U (DESIGN §7.3): libsidplayfp's emulated
# C64, the write tee, core/sidout's clock adapter and sequences, and the hardsid driver, on
# one thread. The stepping stone before the player's SID-out service. Not a CTest entry: it
# needs the unit and makes sound; `--dry-run` plays into hardsid_probe's simulated unit with
# no USB I/O. Built together with the tests so it keeps compiling; never installed or shipped.

add_executable(hardsid_play
    main.cpp
    # The simulated unit, the transfer trace and the stop handler are the probe's.
    ../hardsid_probe/session.cpp
)
target_include_directories(hardsid_play PRIVATE
    "${CMAKE_CURRENT_SOURCE_DIR}/../hardsid_probe"
    "${CMAKE_CURRENT_SOURCE_DIR}/../common"
)
target_link_libraries(hardsid_play PRIVATE
    flipsid::hardsid flipsid::sidout flipsid::player flipsid::engines ext::sidplayfp)
# Where flipSID's own C64 ROMs are, for RSID tunes (assets/roms/C64).
target_compile_definitions(hardsid_play PRIVATE
    "FLIPSID_SOURCE_DIR=\"${PROJECT_SOURCE_DIR}\""
)
flipsid_configure_target(hardsid_play)
if(WIN32)
    target_link_libraries(hardsid_play PRIVATE shell32)
endif()
