add_library(libSceDepth SHARED EXCLUDE_FROM_ALL Export.cpp)
target_include_directories(libSceDepth PRIVATE ${LIBS_INCLUDE_DIR})
configure_windows_unwind(libSceDepth)

if(BUILD_TESTING)
    add_test_executable(guest_depth_rectification_tests ${LIBS_INCLUDE_DIR}/tests/GuestDepthRectification.cpp)
    target_include_directories(guest_depth_rectification_tests PRIVATE ${LIBS_INCLUDE_DIR})
    target_link_libraries(guest_depth_rectification_tests PRIVATE libSceDepth libc)
    configure_windows_unwind(guest_depth_rectification_tests)
    add_test(NAME guest_depth_rectification COMMAND guest_depth_rectification_tests)
    if(WIN32)
        set_tests_properties(guest_depth_rectification PROPERTIES ENVIRONMENT_MODIFICATION
            "PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceDepth>")
    endif()
    add_test_executable(guest_depth_handles_tests ${LIBS_INCLUDE_DIR}/tests/GuestDepthHandles.cpp)
    target_include_directories(guest_depth_handles_tests PRIVATE ${LIBS_INCLUDE_DIR})
    target_link_libraries(guest_depth_handles_tests PRIVATE libSceDepth libc)
    configure_windows_unwind(guest_depth_handles_tests)
    add_test(NAME guest_depth_handles COMMAND guest_depth_handles_tests)
    if(WIN32)
        set_tests_properties(guest_depth_handles PROPERTIES ENVIRONMENT_MODIFICATION
            "PATH=path_list_prepend:$<TARGET_FILE_DIR:libSceDepth>")
    endif()
endif()
