From 66cd85354b97089136f368aab622804fc284260f Mon Sep 17 00:00:00 2001 From: talregev Date: Wed, 4 Sep 2024 15:14:47 +0300 Subject: [PATCH 1/5] Change public headers to support msh3 (#4525) --- src/bin/CMakeLists.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/bin/CMakeLists.txt b/src/bin/CMakeLists.txt index 23768235e8..5b1f54c704 100644 --- a/src/bin/CMakeLists.txt +++ b/src/bin/CMakeLists.txt @@ -263,11 +263,7 @@ else() $) endif() -set(PUBLIC_HEADERS - ../inc/msquic.h - ../inc/msquic_winuser.h - ../inc/msquic_posix.h - ../inc/quic_sal_stub.h) +file(GLOB PUBLIC_HEADERS "../inc/*.h" "../inc/*.hpp") if(BUILD_SHARED_LIBS) install(TARGETS msquic EXPORT msquic DESTINATION lib) From 76be7d335f18ab72fa58ffdf41abb313deb687ca Mon Sep 17 00:00:00 2001 From: talregev Date: Mon, 14 Oct 2024 18:46:54 +0300 Subject: [PATCH 2/5] simplify export include dir cmake code (#4575) --- src/bin/CMakeLists.txt | 13 ------------- src/inc/CMakeLists.txt | 4 +++- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/bin/CMakeLists.txt b/src/bin/CMakeLists.txt index 5b1f54c704..7c75e06fef 100644 --- a/src/bin/CMakeLists.txt +++ b/src/bin/CMakeLists.txt @@ -250,19 +250,6 @@ elseif (CX_PLATFORM STREQUAL "darwin") PROPERTIES LINK_FLAGS "-exported_symbols_list \"${CMAKE_CURRENT_SOURCE_DIR}/darwin/exports.txt\"") endif() -if(BUILD_SHARED_LIBS) - target_include_directories(msquic PUBLIC - $ - $) -else() - target_include_directories(msquic_static INTERFACE - $ - $) - target_include_directories(msquic INTERFACE - $ - $) -endif() - file(GLOB PUBLIC_HEADERS "../inc/*.h" "../inc/*.hpp") if(BUILD_SHARED_LIBS) diff --git a/src/inc/CMakeLists.txt b/src/inc/CMakeLists.txt index 94daef9a66..dde47b8252 100644 --- a/src/inc/CMakeLists.txt +++ b/src/inc/CMakeLists.txt @@ -9,7 +9,9 @@ target_compile_options(inc INTERFACE ${QUIC_C_FLAGS}) target_compile_options(inc INTERFACE $<$:${QUIC_CXX_FLAGS}>) target_compile_definitions(inc INTERFACE ${QUIC_COMMON_DEFINES}) -target_include_directories(inc INTERFACE ${QUIC_INCLUDE_DIR}) +target_include_directories(inc INTERFACE + $ + $) target_compile_features(inc INTERFACE cxx_std_17) target_compile_features(inc INTERFACE c_std_11) From 451bf8c30c08a4fee6b74b63771ac4f463ba5fe1 Mon Sep 17 00:00:00 2001 From: Maxim Ivanov Date: Fri, 25 Oct 2024 12:44:09 +0100 Subject: [PATCH 3/5] Delegate build environment configuration with QUIC_EXTERNAL_TOOLCHAIN (#4625) Well managed CMake build environments make use of CMAKE_TOOLCHAIN_FILE to configure build environment such as include/lib search paths, system libraries, build flags, etc. This change introduces QUIC_EXTERNAL_TOOLCHAIN build option, which when enabled stops MSQuic CMake scripts from attempting to do CMake toolchain job. QUIC_EXTERNAL_TOOLCHAIN defaults to OFF to preserve original behaviour. --- CMakeLists.txt | 7 ++++++- src/inc/CMakeLists.txt | 11 +++++++---- src/platform/CMakeLists.txt | 5 ++++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 80999f69e7..c443b15bba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,6 +89,7 @@ option(QUIC_STATIC_LINK_CRT "Statically links the C runtime" ON) option(QUIC_STATIC_LINK_PARTIAL_CRT "Statically links the compiler-specific portion of the C runtime" ON) option(QUIC_UWP_BUILD "Build for UWP" OFF) option(QUIC_GAMECORE_BUILD "Build for GameCore" OFF) +option(QUIC_EXTERNAL_TOOLCHAIN "Enable if system libs and include paths are configured by CMake toolchain" OFF) option(QUIC_PGO "Enables profile guided optimizations" OFF) option(QUIC_LINUX_XDP_ENABLED "Enables XDP support" OFF) option(QUIC_SOURCE_LINK "Enables source linking on MSVC" ON) @@ -477,7 +478,11 @@ if(WIN32) endif() if (QUIC_GAMECORE_BUILD) - list(APPEND QUIC_COMMON_DEFINES WINAPI_FAMILY=WINAPI_FAMILY_GAMES QUIC_GAMECORE_BUILD QUIC_RESTRICTED_BUILD) + list(APPEND QUIC_COMMON_DEFINES QUIC_GAMECORE_BUILD QUIC_RESTRICTED_BUILD) + endif() + + if (QUIC_GAMECORE_BUILD AND NOT QUIC_EXTERNAL_TOOLCHAIN) + list(APPEND QUIC_COMMON_DEFINES WINAPI_FAMILY=WINAPI_FAMILY_GAMES) set(CMAKE_CXX_STANDARD_LIBRARIES "") set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "") set(CMAKE_C_STANDARD_LIBRARIES "") diff --git a/src/inc/CMakeLists.txt b/src/inc/CMakeLists.txt index dde47b8252..48edebd1e0 100644 --- a/src/inc/CMakeLists.txt +++ b/src/inc/CMakeLists.txt @@ -42,10 +42,13 @@ if(WIN32) if(QUIC_UWP_BUILD) target_link_libraries(base_link INTERFACE OneCore ws2_32 ntdll) elseif(QUIC_GAMECORE_BUILD) - target_link_options(inc INTERFACE ${Console_LinkOptions}) - target_compile_options(inc INTERFACE ${Console_ArchOptions}) - target_link_directories(inc INTERFACE ${Console_EndpointLibRoot}) - target_link_libraries(base_link INTERFACE xgameplatform ntdll advapi32) + target_link_libraries(base_link INTERFACE ntdll advapi32) + if(NOT QUIC_EXTERNAL_TOOLCHAIN) + target_link_options(inc INTERFACE ${Console_LinkOptions}) + target_compile_options(inc INTERFACE ${Console_ArchOptions}) + target_link_directories(inc INTERFACE ${Console_EndpointLibRoot}) + target_link_libraries(base_link INTERFACE xgameplatform) + endif() else() target_link_libraries(base_link INTERFACE ws2_32 schannel ntdll bcrypt ncrypt crypt32 iphlpapi advapi32) endif() diff --git a/src/platform/CMakeLists.txt b/src/platform/CMakeLists.txt index d79d16841d..43dc1a7776 100644 --- a/src/platform/CMakeLists.txt +++ b/src/platform/CMakeLists.txt @@ -126,5 +126,8 @@ if(QUIC_TLS STREQUAL "openssl" OR QUIC_TLS STREQUAL "openssl3") target_link_libraries(platform PUBLIC "-framework CoreFoundation" "-framework Security") endif() elseif(QUIC_TLS STREQUAL "schannel") - target_link_libraries(platform PUBLIC secur32 onecore) + target_link_libraries(platform PUBLIC secur32) + if (NOT QUIC_GAMECORE_BUILD) + target_link_libraries(platform PUBLIC onecore) + endif() endif() From b458188ef9c6dc4673316c226d46da83ed124dab Mon Sep 17 00:00:00 2001 From: talregev Date: Thu, 7 Nov 2024 16:52:39 +0200 Subject: [PATCH 4/5] export platform (#4574) --- .github/workflows/build-reuse-win.yml | 7 ++++ CMakeLists.txt | 4 +- src/bin/CMakeLists.txt | 20 +++++++--- src/core/unittest/CMakeLists.txt | 2 +- src/generated/CMakeLists.txt | 12 ++++-- src/perf/bin/CMakeLists.txt | 2 +- src/platform/CMakeLists.txt | 34 ++++++++--------- src/platform/unittest/CMakeLists.txt | 2 +- src/platform/unittest/external/CMakeLists.txt | 38 +++++++++++++++++++ src/test/bin/CMakeLists.txt | 2 +- src/tools/CMakeLists.txt | 2 +- src/tools/attack/CMakeLists.txt | 2 +- src/tools/pcp/CMakeLists.txt | 4 +- src/tools/recvfuzz/CMakeLists.txt | 2 +- submodules/CMakeLists.txt | 8 ++-- 15 files changed, 102 insertions(+), 39 deletions(-) create mode 100644 src/platform/unittest/external/CMakeLists.txt diff --git a/.github/workflows/build-reuse-win.yml b/.github/workflows/build-reuse-win.yml index 8cbab25857..20fd3f893f 100644 --- a/.github/workflows/build-reuse-win.yml +++ b/.github/workflows/build-reuse-win.yml @@ -86,6 +86,13 @@ jobs: if: inputs.build == '-Test' shell: pwsh run: scripts/build.ps1 -Config ${{ inputs.config }} -Platform ${{ inputs.plat }} -Arch ${{ inputs.arch }} -Tls ${{ inputs.tls }} -DisablePerf -DynamicCRT ${{ inputs.sanitize }} + - name: Build External Platform Test + if: inputs.build == '-Test' && inputs.sanitize != '-Sanitize' + shell: pwsh + run: | + cmake --install build\${{ inputs.plat }}\${{ inputs.arch }}_${{ inputs.tls }} --config ${{ inputs.config }} + cmake src/platform/unittest/external -G "Visual Studio 17 2022" -A ${{ inputs.arch }} -B build_external "-DCMAKE_INSTALL_PREFIX:PATH=C:/Program Files/msquic" -DQUIC_TLS=${{ inputs.tls }} + cmake --build build_external --config ${{ inputs.config }} - name: Build For Perf if: inputs.build == '-Perf' shell: pwsh diff --git a/CMakeLists.txt b/CMakeLists.txt index c443b15bba..522118f86c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -460,7 +460,9 @@ if(WIN32) set_property(TARGET MsQuicEtw_HeaderBuild PROPERTY FOLDER "${QUIC_FOLDER_PREFIX}helpers") add_library(MsQuicEtw_Header INTERFACE) - target_include_directories(MsQuicEtw_Header INTERFACE ${QUIC_BUILD_DIR}/inc) + target_include_directories(MsQuicEtw_Header INTERFACE + $ + $) add_dependencies(MsQuicEtw_Header MsQuicEtw_HeaderBuild) add_library(MsQuicEtw_Resource OBJECT ${QUIC_BUILD_DIR}/inc/MsQuicEtw.rc) diff --git a/src/bin/CMakeLists.txt b/src/bin/CMakeLists.txt index 7c75e06fef..18048e3b72 100644 --- a/src/bin/CMakeLists.txt +++ b/src/bin/CMakeLists.txt @@ -11,7 +11,7 @@ endif() if(BUILD_SHARED_LIBS) add_library(msquic SHARED ${SOURCES}) - target_link_libraries(msquic PRIVATE core platform inc warnings logging base_link main_binary_link_args) + target_link_libraries(msquic PRIVATE core msquic_platform inc warnings logging base_link main_binary_link_args) set_target_properties(msquic PROPERTIES OUTPUT_NAME ${QUIC_LIBRARY_NAME}) if (NOT WIN32) set_target_properties(msquic PROPERTIES SOVERSION ${QUIC_MAJOR_VERSION} VERSION ${QUIC_FULL_VERSION}) @@ -21,7 +21,7 @@ if(BUILD_SHARED_LIBS) endif() else() add_library(msquic_static STATIC static/empty.c) - target_link_libraries(msquic_static PRIVATE core platform inc logging main_binary_link_args) + target_link_libraries(msquic_static PRIVATE core msquic_platform inc logging main_binary_link_args) target_compile_definitions(msquic_static PUBLIC QUIC_BUILD_STATIC) set_property(TARGET msquic_static PROPERTY FOLDER "${QUIC_FOLDER_PREFIX}libraries") @@ -150,7 +150,7 @@ else() COMMAND libtool -static -o \"${QUIC_STATIC_LIBRARY}\" @${QUIC_DEPS_FILE} DEPENDS ${QUIC_DEPS_FILE} DEPENDS core - DEPENDS platform + DEPENDS msquic_platform DEPENDS msquic_static ) elseif(WIN32) @@ -181,7 +181,7 @@ else() COMMAND ${CMAKE_COMMAND} -E copy "${QUIC_STATIC_LIBRARY}" "${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}" DEPENDS ${QUIC_DEPS_FILE} DEPENDS core - DEPENDS platform + DEPENDS msquic_platform DEPENDS msquic_static ) else() @@ -205,7 +205,7 @@ else() COMMAND ${CMAKE_AR} -M < ${QUIC_DEPS_FILE} DEPENDS ${QUIC_DEPS_FILE} DEPENDS core - DEPENDS platform + DEPENDS msquic_platform DEPENDS msquic_static ) endif() @@ -252,8 +252,16 @@ endif() file(GLOB PUBLIC_HEADERS "../inc/*.h" "../inc/*.hpp") +if(QUIC_TLS STREQUAL "openssl" OR QUIC_TLS STREQUAL "openssl3") + list(APPEND OTHER_TARGETS OpenSSL OpenSSLQuic) +endif() + +if(WIN32) + list(APPEND OTHER_TARGETS MsQuicEtw_Header) +endif() + if(BUILD_SHARED_LIBS) - install(TARGETS msquic EXPORT msquic DESTINATION lib) + install(TARGETS msquic msquic_platform inc logging_inc warnings main_binary_link_args ${OTHER_TARGETS} EXPORT msquic DESTINATION lib) else() install(FILES ${QUIC_STATIC_LIBRARY} DESTINATION lib) endif() diff --git a/src/core/unittest/CMakeLists.txt b/src/core/unittest/CMakeLists.txt index 4f811b475e..4e4170cf99 100644 --- a/src/core/unittest/CMakeLists.txt +++ b/src/core/unittest/CMakeLists.txt @@ -27,7 +27,7 @@ set_property(TARGET msquiccoretest APPEND PROPERTY BUILD_RPATH "$ORIGIN") target_link_libraries(msquiccoretest msquic) if (BUILD_SHARED_LIBS) - target_link_libraries(msquiccoretest core platform) + target_link_libraries(msquiccoretest core msquic_platform) endif() target_link_libraries(msquiccoretest inc gtest warnings logging base_link) diff --git a/src/generated/CMakeLists.txt b/src/generated/CMakeLists.txt index 19c49f1bf3..93bd6cc9a2 100644 --- a/src/generated/CMakeLists.txt +++ b/src/generated/CMakeLists.txt @@ -23,9 +23,15 @@ if(QUIC_ENABLE_LOGGING) target_link_libraries(logging PRIVATE inc) elseif(QUIC_LOGGING_TYPE STREQUAL "lttng") - target_include_directories(logging_inc INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/common) - target_include_directories(logging_inc INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/linux) - target_include_directories(logging_inc INTERFACE ${LTTNGUST_INCLUDE_DIRS}) + target_include_directories(logging_inc INTERFACE + $ + $) + target_include_directories(logging_inc INTERFACE + $ + $) + target_include_directories(logging_inc INTERFACE + $ + $) FILE(GLOB LOGGING_FILES ${CMAKE_CURRENT_SOURCE_DIR}/linux/*.c) add_library(logging STATIC ${LOGGING_FILES}) diff --git a/src/perf/bin/CMakeLists.txt b/src/perf/bin/CMakeLists.txt index 788f15bc7b..86fa457c66 100644 --- a/src/perf/bin/CMakeLists.txt +++ b/src/perf/bin/CMakeLists.txt @@ -12,7 +12,7 @@ set_property(TARGET secnetperf PROPERTY FOLDER "${QUIC_FOLDER_PREFIX}perf") target_link_libraries(secnetperf inc warnings perflib msquic) if (BUILD_SHARED_LIBS) - target_link_libraries(secnetperf platform) + target_link_libraries(secnetperf msquic_platform) endif() target_link_libraries(secnetperf logging base_link) diff --git a/src/platform/CMakeLists.txt b/src/platform/CMakeLists.txt index 43dc1a7776..4a573ae493 100644 --- a/src/platform/CMakeLists.txt +++ b/src/platform/CMakeLists.txt @@ -53,21 +53,21 @@ else() message(FATAL_ERROR "TLS Provider not configured") endif() -add_library(platform STATIC ${SOURCES}) +add_library(msquic_platform STATIC ${SOURCES}) if("${CX_PLATFORM}" STREQUAL "windows") target_link_libraries( - platform + msquic_platform PUBLIC wbemuuid) - target_link_libraries(platform PUBLIC winmm) + target_link_libraries(msquic_platform PUBLIC winmm) elseif(QUIC_LINUX_XDP_ENABLED) find_library(NL_LIB nl-3) find_library(NL_ROUTE_LIB nl-route-3) find_library(XDP_LIB libxdp.so) find_library(BPF_LIB libbpf.so) - target_include_directories(platform PRIVATE /usr/include/xdp) - target_include_directories(platform PRIVATE /usr/include/bpf) + target_include_directories(msquic_platform PRIVATE /usr/include/xdp) + target_include_directories(msquic_platform PRIVATE /usr/include/bpf) set(XDP_PROG_INCLUDE_DIR "-I/usr/include/bpf") # building XDP program @@ -82,7 +82,7 @@ elseif(QUIC_LINUX_XDP_ENABLED) DEPENDS ${PROJECT_SOURCE_DIR}/src/platform/datapath_raw_xdp_linux_kern.c ) add_custom_target(xdp_program DEPENDS ${QUIC_OUTPUT_DIR}/datapath_raw_xdp_kern.o) - add_dependencies(platform xdp_program) + add_dependencies(msquic_platform xdp_program) if (NOT BUILD_SHARED_LIBS) find_library(ELF_LIB elf) # for static @@ -97,37 +97,37 @@ elseif(QUIC_LINUX_XDP_ENABLED) string(REPLACE ".so" ".a" BPF_LIB ${BPF_LIB}) endif() - target_link_libraries(platform PUBLIC ${XDP_LIB} ${BPF_LIB} ${NL_LIB} ${NL_ROUTE_LIB} ${ELF_LIB} ${Z_LIB} ${ZSTD_LIB}) + target_link_libraries(msquic_platform PUBLIC ${XDP_LIB} ${BPF_LIB} ${NL_LIB} ${NL_ROUTE_LIB} ${ELF_LIB} ${Z_LIB} ${ZSTD_LIB}) endif() -target_link_libraries(platform PUBLIC inc) -target_link_libraries(platform PRIVATE warnings main_binary_link_args) +target_link_libraries(msquic_platform PUBLIC inc) +target_link_libraries(msquic_platform PRIVATE warnings main_binary_link_args) -set_property(TARGET platform PROPERTY FOLDER "${QUIC_FOLDER_PREFIX}libraries") +set_property(TARGET msquic_platform PROPERTY FOLDER "${QUIC_FOLDER_PREFIX}libraries") if ("${CX_PLATFORM}" STREQUAL "windows") target_include_directories( - platform + msquic_platform PRIVATE ${EXTRA_PLATFORM_INCLUDE_DIRECTORIES} ${PROJECT_SOURCE_DIR}/submodules/xdp-for-windows/published/external) elseif(QUIC_LINUX_XDP_ENABLED) include_directories(/usr/include/libnl3) - target_include_directories(platform PRIVATE ${EXTRA_PLATFORM_INCLUDE_DIRECTORIES}) + target_include_directories(msquic_platform PRIVATE ${EXTRA_PLATFORM_INCLUDE_DIRECTORIES}) endif() if (MSVC AND (QUIC_TLS STREQUAL "openssl" OR QUIC_TLS STREQUAL "schannel") AND NOT QUIC_ENABLE_SANITIZERS) - target_compile_options(platform PRIVATE /analyze) + target_compile_options(msquic_platform PRIVATE /analyze) endif() if(QUIC_TLS STREQUAL "openssl" OR QUIC_TLS STREQUAL "openssl3") - target_link_libraries(platform PUBLIC OpenSSL) + target_link_libraries(msquic_platform PUBLIC OpenSSL) if (CX_PLATFORM STREQUAL "darwin") - target_link_libraries(platform PUBLIC "-framework CoreFoundation" "-framework Security") + target_link_libraries(msquic_platform PUBLIC "-framework CoreFoundation" "-framework Security") endif() elseif(QUIC_TLS STREQUAL "schannel") - target_link_libraries(platform PUBLIC secur32) + target_link_libraries(msquic_platform PUBLIC secur32) if (NOT QUIC_GAMECORE_BUILD) - target_link_libraries(platform PUBLIC onecore) + target_link_libraries(msquic_platform PUBLIC onecore) endif() endif() diff --git a/src/platform/unittest/CMakeLists.txt b/src/platform/unittest/CMakeLists.txt index e514d6634a..997066bb10 100644 --- a/src/platform/unittest/CMakeLists.txt +++ b/src/platform/unittest/CMakeLists.txt @@ -20,7 +20,7 @@ set_property(TARGET msquicplatformtest APPEND PROPERTY BUILD_RPATH "$ORIGIN") target_link_libraries(msquicplatformtest msquic) if (BUILD_SHARED_LIBS) - target_link_libraries(msquicplatformtest platform) + target_link_libraries(msquicplatformtest msquic_platform) endif() target_link_libraries(msquicplatformtest inc gtest warnings logging base_link) diff --git a/src/platform/unittest/external/CMakeLists.txt b/src/platform/unittest/external/CMakeLists.txt new file mode 100644 index 0000000000..d878be6b6c --- /dev/null +++ b/src/platform/unittest/external/CMakeLists.txt @@ -0,0 +1,38 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +cmake_minimum_required(VERSION 3.16) + +project(msquic_platform_external) + +find_package(msquic REQUIRED) +find_library(MSPLATFORM_LIBRARIES + NAMES msquic_platform) + +message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}") +message(STATUS "MSPLATFORM_LIBRARIES: ${MSPLATFORM_LIBRARIES}") + +include(FetchContent) +FetchContent_Declare( + googletest + SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../../submodules/googletest +) +FetchContent_MakeAvailable(googletest) + +set(SOURCES + ../main.cpp + ../CryptTest.cpp + ../DataPathTest.cpp + ../PlatformTest.cpp + # ../StorageTest.cpp + ../TlsTest.cpp +) + +if(QUIC_TLS STREQUAL "openssl" OR QUIC_TLS STREQUAL "openssl3") + list(APPEND OTHER_TERGETS OpenSSL) +endif() + +add_executable(msquicplatformtest ${SOURCES}) +target_include_directories(msquicplatformtest PRIVATE ${CMAKE_INSTALL_PREFIX}/include) +target_link_libraries(msquicplatformtest PRIVATE msquic ${MSPLATFORM_LIBRARIES} ${OTHER_TERGETS} gtest ws2_32 schannel ntdll bcrypt ncrypt crypt32 iphlpapi advapi32 secur32 userenv onecore winmm clang_rt.asan_dbg_dynamic-x86_64 clang_rt.asan_dynamic-x86_64) +target_compile_definitions(msquicplatformtest PRIVATE QUIC_EVENTS_STUB QUIC_LOGS_STUB _DISABLE_VECTOR_ANNOTATION _DISABLE_STRING_ANNOTATION) diff --git a/src/test/bin/CMakeLists.txt b/src/test/bin/CMakeLists.txt index 895d64d053..c4388894f5 100644 --- a/src/test/bin/CMakeLists.txt +++ b/src/test/bin/CMakeLists.txt @@ -16,7 +16,7 @@ set_property(TARGET msquictest APPEND PROPERTY BUILD_RPATH "$ORIGIN") target_link_libraries(msquictest msquic testlib) if (BUILD_SHARED_LIBS) - target_link_libraries(msquictest platform) + target_link_libraries(msquictest msquic_platform) endif() target_link_libraries(msquictest inc gtest logging base_link) diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index 48519c06c1..14582b3d7a 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -9,7 +9,7 @@ function(add_quic_tool) target_link_libraries(${targetname} inc warnings msquic) if (BUILD_SHARED_LIBS) - target_link_libraries(${targetname} platform) + target_link_libraries(${targetname} msquic_platform) endif() target_link_libraries(${targetname} logging base_link) diff --git a/src/tools/attack/CMakeLists.txt b/src/tools/attack/CMakeLists.txt index 23fcf87861..04ef2eb761 100644 --- a/src/tools/attack/CMakeLists.txt +++ b/src/tools/attack/CMakeLists.txt @@ -12,7 +12,7 @@ target_include_directories(quicattack PRIVATE ${PROJECT_SOURCE_DIR}/src/core) target_link_libraries(quicattack) if (BUILD_SHARED_LIBS) - target_link_libraries(quicattack core platform) + target_link_libraries(quicattack core msquic_platform) endif() target_link_libraries(quicattack logging) diff --git a/src/tools/pcp/CMakeLists.txt b/src/tools/pcp/CMakeLists.txt index 43761a8758..f9f6d6d50e 100644 --- a/src/tools/pcp/CMakeLists.txt +++ b/src/tools/pcp/CMakeLists.txt @@ -8,5 +8,5 @@ set(SOURCES add_quic_tool(quicpcp ${SOURCES}) target_include_directories(quicpcp PRIVATE ${PROJECT_SOURCE_DIR}/src/core) -# OK to include platform a second time, will not cause multiple link issues -target_link_libraries(quicpcp core platform) +# OK to include msquic_platform a second time, will not cause multiple link issues +target_link_libraries(quicpcp core msquic_platform) diff --git a/src/tools/recvfuzz/CMakeLists.txt b/src/tools/recvfuzz/CMakeLists.txt index 60af99758c..c8d56aead8 100644 --- a/src/tools/recvfuzz/CMakeLists.txt +++ b/src/tools/recvfuzz/CMakeLists.txt @@ -7,5 +7,5 @@ endif() add_quic_tool(recvfuzz recvfuzz.cpp) target_include_directories(recvfuzz PRIVATE ${PROJECT_SOURCE_DIR}/src/core) if (BUILD_SHARED_LIBS) - target_link_libraries(recvfuzz core msquic platform) + target_link_libraries(recvfuzz core msquic msquic_platform) endif() diff --git a/submodules/CMakeLists.txt b/submodules/CMakeLists.txt index a6c5929512..4bf8117629 100644 --- a/submodules/CMakeLists.txt +++ b/submodules/CMakeLists.txt @@ -157,8 +157,9 @@ if (WIN32) target_include_directories( OpenSSLQuic INTERFACE - $<$:${OPENSSL_DIR}/debug/include> - $<$>:${OPENSSL_DIR}/release/include> + $:${OPENSSL_DIR}/debug/include> + $<$>:${OPENSSL_DIR}/release/include>> + $ ) target_link_libraries( OpenSSLQuic @@ -327,7 +328,8 @@ else() target_include_directories( OpenSSLQuic INTERFACE - ${OPENSSL_DIR}/include + $ + $ ) target_link_libraries( From d64952cf18d72579a705895ac6dbc166d5323edb Mon Sep 17 00:00:00 2001 From: talregev Date: Thu, 5 Dec 2024 02:24:28 +0200 Subject: [PATCH 5/5] Add wbemuuid (#4687) --- src/platform/unittest/external/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/unittest/external/CMakeLists.txt b/src/platform/unittest/external/CMakeLists.txt index d878be6b6c..805b18ff40 100644 --- a/src/platform/unittest/external/CMakeLists.txt +++ b/src/platform/unittest/external/CMakeLists.txt @@ -34,5 +34,5 @@ endif() add_executable(msquicplatformtest ${SOURCES}) target_include_directories(msquicplatformtest PRIVATE ${CMAKE_INSTALL_PREFIX}/include) -target_link_libraries(msquicplatformtest PRIVATE msquic ${MSPLATFORM_LIBRARIES} ${OTHER_TERGETS} gtest ws2_32 schannel ntdll bcrypt ncrypt crypt32 iphlpapi advapi32 secur32 userenv onecore winmm clang_rt.asan_dbg_dynamic-x86_64 clang_rt.asan_dynamic-x86_64) +target_link_libraries(msquicplatformtest PRIVATE msquic ${MSPLATFORM_LIBRARIES} ${OTHER_TERGETS} gtest ws2_32 schannel ntdll bcrypt ncrypt crypt32 iphlpapi advapi32 secur32 userenv onecore winmm wbemuuid clang_rt.asan_dbg_dynamic-x86_64 clang_rt.asan_dynamic-x86_64) target_compile_definitions(msquicplatformtest PRIVATE QUIC_EVENTS_STUB QUIC_LOGS_STUB _DISABLE_VECTOR_ANNOTATION _DISABLE_STRING_ANNOTATION)