# SPDX-License-Identifier: GPL-3.0-or-later
# SAGE UI screen/widget engine (T-M3-03). Pure C11, no SDL: builds and runs
# without SDL2 exactly like realmrun_core, which it links against (it consumes
# the sage_res reader). SDL glue, if any, stays in src/platform.
add_library(realmrun_ui STATIC
    ui_screen.c
    ui_stack.c
    ui_render.c
    ui_input.c
    font.c
    menu.c
    setup_screen.c
    credits_screen.c
    diplo_report.c
    victory_view.c
    touch_ui.c
    hud.c
)
target_include_directories(realmrun_ui PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(realmrun_ui PUBLIC realmrun_core)
target_compile_options(realmrun_ui PRIVATE -Wall -Wextra -Werror)
realmrun_apply_tune(realmrun_ui)

if(REALMRUN_SANITIZE)
    target_compile_options(realmrun_ui PUBLIC -fsanitize=address,undefined -fno-omit-frame-pointer -g)
    target_link_options(realmrun_ui PUBLIC -fsanitize=address,undefined)
endif()
