# Emulation core: CPU, ANTIC/GTIA/POKEY, memory, media.  Built as a static
# library so both the kat5200 binary and the test suite can link it without
# re-listing the sources.
add_library(kat_core STATIC
    antic.c
    boom6502.c
    cart.c
    console.c
    debug.c
    gtia.c
    media.c
    memory.c
    pia.c
    pokey.c
    pokeysound.c
    sio.c
    )

target_include_directories(kat_core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
# debug.c pulls in ../interface/sdl_if.h, which includes <SDL3/SDL.h>.  On Linux
# SDL3's headers sit in a default search path so this was implicit; on macOS
# (Homebrew, /opt/homebrew/include) and Windows it is not, so link SDL3 here to
# propagate its include dirs.  debug.c uses no SDL symbols, but the imported
# target carries the -I we need (and the harmless link matches kat_interface).
target_link_libraries(kat_core PUBLIC ${ZLIB_LIBRARIES} m SDL3::SDL3)
