# tna_impact - ReXGlue Recompiled Project
#
# SDK boilerplate lives in generated/rexglue.cmake.

cmake_minimum_required(VERSION 3.25)
project(tna_impact LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include(generated/rexglue.cmake)

# Sources
set(TNAIMPACT_SOURCES
    src/main.cpp
    src/debug_sink_device.cpp
    src/math_compat.cpp
    src/tna_debug_hooks.cpp
    src/tna_input_script.cpp
    src/tna_unlock_all.cpp
)

if(WIN32)
    # Exe icon, which SDL also uses for the game window and its taskbar button.
    enable_language(RC)
    set(TNAIMPACT_RC resources/tna_impact.rc)
    set_source_files_properties(${TNAIMPACT_RC} PROPERTIES
        INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/resources")
    add_executable(tna_impact WIN32 ${TNAIMPACT_SOURCES} ${TNAIMPACT_RC})
else()
    add_executable(tna_impact ${TNAIMPACT_SOURCES})
endif()

if(MSVC)
    target_compile_options(tna_impact PRIVATE /utf-8)
endif()

rexglue_setup_target(tna_impact GPU_PLUGINS xenos)

# The v0.10.0 source-tree runtime does not propagate ImGui's include directory
# to the host, although its public UI headers include imgui.h.
if(REXSDK_DIR)
    target_include_directories(tna_impact PRIVATE
        $<TARGET_PROPERTY:imgui::imgui,INTERFACE_INCLUDE_DIRECTORIES>)
endif()
