project(tw_peer_to_peer)

# ── library ───────────────────────────────────────────────────────────────────

set(LIB_FILES
    src/QuicrPeerLink.cpp
    src/TcpPeerLink.cpp
    src/PeerRegistry.cpp
    src/WorldStepProcessor.cpp
    src/PeerWorldController.cpp
    src/TestPeerNode.cpp
)

add_library(tw_peer_to_peer_lib STATIC ${LIB_FILES})
add_library(tw::peer_to_peer ALIAS tw_peer_to_peer_lib)

target_include_directories(tw_peer_to_peer_lib
    PUBLIC
        ${PROJECT_SOURCE_DIR}/src/
        ${JoltPhysics_SOURCE_DIR}/..
)

target_link_libraries(tw_peer_to_peer_lib
    PUBLIC
        tw_common
        tw::network
        tw::quicr
        tw::protocol
        tw::message_protocol
        glm::glm
        EnTT::EnTT
        spdlog::spdlog
)

add_executable(${PROJECT_NAME} src/PeerToPeer.cpp)

target_link_libraries(${PROJECT_NAME}
    PRIVATE
        tw_peer_to_peer_lib
)

add_subdirectory(tests)
