# SPDX-License-Identifier: GPL-2.0-or-later
# SPDX-FileCopyrightText: Copyright (C) 2026 Max A. Vilkki a.k.a. codise
#
# core/sidout: SID register writes for hardware that the host drives with cycle-stamped
# writes (DESIGN §7.3). For now the device-independent pieces the bring-up tools need:
# DeviceOp, our own silence and reset sequences, the clock adapter (tempo, pitch, the write
# gap), the step from a tune's writes to device ops, and the record stream from the render
# thread (it uses common's SpscQueue and TripleBuffer), the SidDevice boundary, the socket
# plan, the scheduler (pure logic, the time passed in) and the service: the thread around the
# scheduler, which gets its unit from a DeviceProvider. No libsidplayfp or USB type enters
# this module.

add_library(flipsid_sidout STATIC
    clock_adapter.cpp
    clock_calibration.cpp
    scheduler.cpp
    sequences.cpp
    sid_out_service.cpp
    sid_stream.cpp
    socket_plan.cpp
    write_ops.cpp
)
add_library(flipsid::sidout ALIAS flipsid_sidout)

target_include_directories(flipsid_sidout PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
find_package(Threads REQUIRED)
target_link_libraries(flipsid_sidout
    PUBLIC flipsid::common
    PRIVATE flipsid::log Threads::Threads
)

flipsid_configure_target(flipsid_sidout)
