Vendor MsQuic with build and install support, add DeviceManager status to configurable heartbeats, and report only enabled devices. Add the local QUIC gateway, protocol coverage, real MsQuic E2E tests, process smoke tests, and updated integration documentation.
77 lines
3.1 KiB
CMake
77 lines
3.1 KiB
CMake
find_package(Threads REQUIRED)
|
|
|
|
add_library(quic_edge_service STATIC
|
|
src/control_framing.cpp
|
|
src/datagram_packetizer.cpp
|
|
src/quic_edge_types.cpp
|
|
src/quic_transport.cpp
|
|
src/quic_edge_service.cpp
|
|
src/quic_edge_device_adapter.cpp
|
|
)
|
|
target_compile_features(quic_edge_service PUBLIC cxx_std_17)
|
|
target_include_directories(quic_edge_service PUBLIC ${PROJECT_SOURCE_DIR}/cmvr-es)
|
|
target_link_libraries(quic_edge_service
|
|
PUBLIC
|
|
cmvr_es::proto
|
|
cmvr_es::media_source_hub
|
|
PRIVATE
|
|
cmvr_es::device_media_source_adapter
|
|
cmvr_es::device_manager
|
|
Threads::Threads
|
|
)
|
|
|
|
if(CMVR_HAS_MSQUIC)
|
|
target_sources(quic_edge_service PRIVATE src/msquic_transport.cpp)
|
|
target_compile_definitions(quic_edge_service PRIVATE CMVR_HAS_MSQUIC=1)
|
|
target_link_libraries(quic_edge_service PRIVATE MsQuic::msquic)
|
|
|
|
# Install only the runtime that FindMsQuic actually selected. Keeping this
|
|
# out of the generic request.txt installer prevents a custom version/root
|
|
# from being mixed with the repository default through the same soname.
|
|
file(REAL_PATH "${MsQuic_LIBRARY}" _cmvr_msquic_library_real)
|
|
if(MsQuic_ROOT AND MsQuic_LIBRARY MATCHES "\\.so")
|
|
get_filename_component(_cmvr_msquic_library_dir "${MsQuic_LIBRARY}" DIRECTORY)
|
|
file(GLOB _cmvr_msquic_library_candidates
|
|
LIST_DIRECTORIES FALSE
|
|
"${_cmvr_msquic_library_dir}/libmsquic.so*")
|
|
set(_cmvr_msquic_selected_chain)
|
|
foreach(_cmvr_msquic_library_candidate
|
|
IN LISTS _cmvr_msquic_library_candidates)
|
|
file(REAL_PATH "${_cmvr_msquic_library_candidate}"
|
|
_cmvr_msquic_candidate_real)
|
|
if(_cmvr_msquic_candidate_real STREQUAL
|
|
_cmvr_msquic_library_real)
|
|
list(APPEND _cmvr_msquic_selected_chain
|
|
"${_cmvr_msquic_library_candidate}")
|
|
endif()
|
|
endforeach()
|
|
if(NOT _cmvr_msquic_selected_chain)
|
|
message(FATAL_ERROR
|
|
"Could not resolve the selected MsQuic runtime chain: "
|
|
"${MsQuic_LIBRARY}")
|
|
endif()
|
|
install(FILES ${_cmvr_msquic_selected_chain} DESTINATION lib)
|
|
endif()
|
|
endif()
|
|
|
|
add_library(cmvr_es::quic_edge_service ALIAS quic_edge_service)
|
|
|
|
if(BUILD_TESTING)
|
|
add_executable(quic_edge_protocol_test tests/quic_edge_protocol_test.cpp)
|
|
target_compile_features(quic_edge_protocol_test PRIVATE cxx_std_17)
|
|
target_link_libraries(quic_edge_protocol_test
|
|
PRIVATE
|
|
cmvr_es::quic_edge_service
|
|
cmvr_es::media_source_hub
|
|
Threads::Threads
|
|
)
|
|
add_test(NAME quic_edge_protocol_test COMMAND quic_edge_protocol_test)
|
|
if(UNIX AND NOT APPLE)
|
|
get_property(_quic_test_library_dirs DIRECTORY PROPERTY LINK_DIRECTORIES)
|
|
list(PREPEND _quic_test_library_dirs "${CMAKE_BINARY_DIR}/cmvr_compiler_runtime")
|
|
list(JOIN _quic_test_library_dirs ":" _quic_test_library_path)
|
|
set_tests_properties(quic_edge_protocol_test PROPERTIES
|
|
ENVIRONMENT "LD_LIBRARY_PATH=${_quic_test_library_path}")
|
|
endif()
|
|
endif()
|