cmake_minimum_required(VERSION 3.20)
project(HazeControllerTests LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 20)
include(../../port/controller-dependency.cmake)
add_executable(test_haze_gamepad ../test_haze_gamepad.cpp ../../port/haze_gamepad.cpp)
target_include_directories(test_haze_gamepad PRIVATE
    "${PS3RECOMP_DIR}/include" "${PS3RECOMP_DIR}/libs/input")
target_link_libraries(test_haze_gamepad PRIVATE SDL3::SDL3)
if(MSVC)
    target_compile_options(test_haze_gamepad PRIVATE /UNDEBUG)
else()
    target_compile_options(test_haze_gamepad PRIVATE -UNDEBUG)
endif()
enable_testing()
add_test(NAME gamepad COMMAND test_haze_gamepad)
add_executable(test_haze_prompts ../test_haze_prompts.cpp)
target_include_directories(test_haze_prompts PRIVATE
    "${PS3RECOMP_DIR}/include" "${PS3RECOMP_DIR}/libs/input" "${PS3RECOMP_DIR}/libs/video")
target_link_libraries(test_haze_prompts PRIVATE windowscodecs ole32 gdi32)
if(MSVC)
    target_compile_options(test_haze_prompts PRIVATE /UNDEBUG)
else()
    target_compile_options(test_haze_prompts PRIVATE -UNDEBUG)
endif()
add_test(NAME prompts COMMAND test_haze_prompts "${CMAKE_CURRENT_SOURCE_DIR}/../..")
add_executable(test_haze_controls_ui ../test_haze_controls_ui.cpp ../../port/haze_gamepad.cpp ../../port/haze_prompts.cpp)
target_include_directories(test_haze_controls_ui PRIVATE
    "${PS3RECOMP_DIR}/include" "${PS3RECOMP_DIR}/libs/input" "${PS3RECOMP_DIR}/libs/video")
target_link_libraries(test_haze_controls_ui PRIVATE SDL3::SDL3 windowscodecs ole32 gdi32 comdlg32)
if(MSVC)
    target_compile_options(test_haze_controls_ui PRIVATE /UNDEBUG)
else()
    target_compile_options(test_haze_controls_ui PRIVATE -UNDEBUG)
endif()
add_test(NAME controls_ui COMMAND test_haze_controls_ui "${CMAKE_CURRENT_SOURCE_DIR}/../..")
