cmake_minimum_required(VERSION 3.25)
project(PsuGpu LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(rexglue CONFIG REQUIRED)
if(NOT REXGLUE_ROOT)
  message(FATAL_ERROR "Pass the pinned ReXGlue source checkout as REXGLUE_ROOT")
endif()
set(REXGLUE_USE_D3D12 ON)
set(REXGLUE_USE_VULKAN OFF)
add_library(rexruntime ALIAS rex::runtime)
add_library(xxHash::xxhash ALIAS rex::xxhash)
function(rex_target_pch target)
  target_precompile_headers(${target} PRIVATE ${ARGN})
endfunction()
function(rexglue_add_version_resource target)
  # The standalone plugin build does not embed SDK application resources.
endfunction()
add_compile_options(-fno-strict-aliasing -ffp-model=strict -fno-char8_t)
add_subdirectory("${REXGLUE_ROOT}/src/graphics" gpu)
rexglue_apply_target_settings(rexgpu-xenos)
target_include_directories(rexgpu-xenos BEFORE PRIVATE "${REXGLUE_ROOT}/include")
option(PSU_GPU_COUNTERS "Enable opt-in CSV frame and pipeline diagnostics" ON)
if(PSU_GPU_COUNTERS)
  target_compile_definitions(rexgpu-xenos PRIVATE REXGLUE_ENABLE_PERF_COUNTERS)
endif()
