# M10.2 QUIC transport (ADR-0090): pinned msquic 2.6.2 with its OpenSSL TLS provider # (OpenSSL 3.5.9 LTS, TLS 1.3 only, built static inside the msquic shared library). # Explicit preparation only: cmake -P tools/prepare-msquic.cmake. On Windows msquic.dll # links the whole C runtime statically (M10.5c): the client package ships it and allows # no runtime DLL imports (ADR-0086), including the UCRT forwarders. Windows builds need a # native Perl (Strawberry Perl) and NASM for OpenSSL, plus nmake from the MSVC shell. include_guard(GLOBAL) include("${PROJECT_SOURCE_DIR}/tools/msquic-pin.cmake") set(msquic_source "${PROJECT_SOURCE_DIR}/build/external/msquic/msquic-${EVO_MSQUIC_VERSION}") if(NOT EXISTS "${msquic_source}/evo-verified.sha256") message(FATAL_ERROR "Prepare msquic explicitly: cmake -P tools/prepare-msquic.cmake") endif() file(STRINGS "${msquic_source}/evo-verified.sha256" verified_msquic) if(NOT verified_msquic STREQUAL "${EVO_MSQUIC_SHA256} ${EVO_OPENSSL_SHA256} ${EVO_XDP_SHA256}") message(FATAL_ERROR "Prepared msquic/OpenSSL do not match the reviewed pins") endif() if(WIN32) find_program(EVO_NATIVE_PERL perl) find_program(EVO_NASM nasm) if(NOT EVO_NATIVE_PERL OR NOT EVO_NASM) message(FATAL_ERROR "msquic's OpenSSL build needs a native Perl (Strawberry Perl) and NASM on PATH") endif() endif() enable_language(C) foreach(setting IN ITEMS "QUIC_TLS_LIB=openssl" "QUIC_BUILD_SHARED=ON" "QUIC_BUILD_TEST=OFF" "QUIC_BUILD_TOOLS=OFF" "QUIC_BUILD_PERF=OFF" "QUIC_ENABLE_LOGGING=OFF" "QUIC_EMBED_GIT_HASH=OFF" "QUIC_SOURCE_LINK=OFF" "QUIC_USE_EXTERNAL_OPENSSL=OFF" "QUIC_CODE_CHECK=OFF" "QUIC_STATIC_LINK_CRT=ON" "QUIC_STATIC_LINK_PARTIAL_CRT=OFF") string(REPLACE "=" ";" pair "${setting}") list(GET pair 0 name) list(GET pair 1 value) set(${name} "${value}" CACHE STRING "Pinned by AEvolution (ADR-0090)" FORCE) endforeach() add_subdirectory("${msquic_source}" "${PROJECT_BINARY_DIR}/msquic" EXCLUDE_FROM_ALL SYSTEM) # Upstream compiles itself with warnings as errors (and MSVC /analyze). As for Mbed TLS, # compiler-version-specific diagnostics must not fail unmodified upstream sources # (MSVC 19.44 /analyze reports C28020 in crypto_tls.c); owned code keeps its policy. if(MSVC) target_compile_options(warnings INTERFACE /WX-) else() target_compile_options(warnings INTERFACE -Wno-error) endif() # Consumer target: the public C API header and the shared library. add_library(evo_msquic INTERFACE) target_include_directories(evo_msquic SYSTEM INTERFACE "${msquic_source}/src/inc") target_link_libraries(evo_msquic INTERFACE msquic) if(WIN32) # msquic.h's inline address helpers (QuicAddrFromString) call Rtl* functions in ntdll. target_link_libraries(evo_msquic INTERFACE ntdll) endif() # The shared library must sit next to Windows executables that load it. function(evo_msquic_runtime target) if(WIN32) add_custom_command(TARGET ${target} POST_BUILD COMMAND "${CMAKE_COMMAND}" -E copy_if_different "$" "$" VERBATIM) endif() endfunction()