# Host validation of the PS5 platform adapters. This is NOT a console binary.
add_library(outrun_ps5_platform STATIC ../src/input/dual_sense.cpp ../src/input/runtime_adapter.cpp)
target_include_directories(outrun_ps5_platform PUBLIC source)
target_link_libraries(outrun_ps5_platform PUBLIC outrun_native_runtime)
target_compile_features(outrun_ps5_platform PUBLIC cxx_std_17)
if(MSVC)
  target_compile_options(outrun_ps5_platform PRIVATE /W4 /fp:strict)
else()
  target_compile_options(outrun_ps5_platform PRIVATE -Wall -Wextra -Wpedantic -ffp-contract=off -fno-fast-math)
endif()
add_executable(test_ps5_input tests/test_input.cpp)
target_link_libraries(test_ps5_input PRIVATE outrun_ps5_platform)
add_test(NAME ps5_input_game_boundary COMMAND test_ps5_input)
set_tests_properties(ps5_input_game_boundary PROPERTIES LABELS "ps5;input")
add_executable(test_ps5_resources tests/test_resources.cpp)
target_link_libraries(test_ps5_resources PRIVATE outrun_native_runtime)
add_test(NAME ps5_renderer_resources COMMAND test_ps5_resources)
set_tests_properties(ps5_renderer_resources PROPERTIES LABELS "ps5;render")
# The PS5 tests read the EXE-owned tables from the player's EXE image (see the top-level OR2_EXE).
if(OR2_EXE)
  set_tests_properties(ps5_input_game_boundary ps5_renderer_resources PROPERTIES ENVIRONMENT "OR2_EXE=${OR2_EXE}")
endif()
