diff --git a/.github/workflows/build-reuse-win.yml b/.github/workflows/build-reuse-win.yml index 7b65871bdf..e13e5ef9f2 100644 --- a/.github/workflows/build-reuse-win.yml +++ b/.github/workflows/build-reuse-win.yml @@ -87,11 +87,11 @@ jobs: 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' + if: inputs.build == '-Test' 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 src/platform/unittest/external -G "Visual Studio 17 2022" -A ${{ inputs.arch }} -B build_external "-DCMAKE_INSTALL_PREFIX:PATH=C:/Program Files/msquic" cmake --build build_external --config ${{ inputs.config }} - name: Build For Perf if: inputs.build == '-Perf' diff --git a/src/bin/CMakeLists.txt b/src/bin/CMakeLists.txt index 1262cb20b4..6b84d4555c 100644 --- a/src/bin/CMakeLists.txt +++ b/src/bin/CMakeLists.txt @@ -274,7 +274,7 @@ configure_file(msquic-config.cmake.in ${CMAKE_BINARY_DIR}/msquic-config.cmake) install(FILES ${CMAKE_BINARY_DIR}/msquic-config.cmake DESTINATION share/msquic) if(BUILD_SHARED_LIBS) - install(EXPORT msquic DESTINATION share/msquic) + install(EXPORT msquic NAMESPACE msquic:: DESTINATION share/msquic) endif() if (MSVC AND NOT QUIC_ENABLE_SANITIZERS AND BUILD_SHARED_LIBS) diff --git a/src/platform/unittest/external/CMakeLists.txt b/src/platform/unittest/external/CMakeLists.txt index 805b18ff40..cfb1ccba9b 100644 --- a/src/platform/unittest/external/CMakeLists.txt +++ b/src/platform/unittest/external/CMakeLists.txt @@ -5,12 +5,9 @@ cmake_minimum_required(VERSION 3.16) project(msquic_platform_external) -find_package(msquic REQUIRED) -find_library(MSPLATFORM_LIBRARIES - NAMES msquic_platform) +find_package(msquic CONFIG REQUIRED) message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}") -message(STATUS "MSPLATFORM_LIBRARIES: ${MSPLATFORM_LIBRARIES}") include(FetchContent) FetchContent_Declare( @@ -28,11 +25,12 @@ set(SOURCES ../TlsTest.cpp ) -if(QUIC_TLS STREQUAL "openssl" OR QUIC_TLS STREQUAL "openssl3") - list(APPEND OTHER_TERGETS OpenSSL) -endif() +# Remove QUIC_EVENTS_MANIFEST_ETW and QUIC_LOGS_MANIFEST_ETW definitions. These definitions for internal use in msquic +get_target_property(defs msquic::inc INTERFACE_COMPILE_DEFINITIONS) +list(FILTER defs EXCLUDE REGEX "^(QUIC_EVENTS_MANIFEST_ETW|QUIC_LOGS_MANIFEST_ETW)$") +set_target_properties(msquic::inc PROPERTIES INTERFACE_COMPILE_DEFINITIONS "${defs}") 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 wbemuuid clang_rt.asan_dbg_dynamic-x86_64 clang_rt.asan_dynamic-x86_64) +target_link_libraries(msquicplatformtest PRIVATE gtest msquic::msquic msquic::msquic_platform ws2_32 ntdll ncrypt crypt32 iphlpapi) target_compile_definitions(msquicplatformtest PRIVATE QUIC_EVENTS_STUB QUIC_LOGS_STUB _DISABLE_VECTOR_ANNOTATION _DISABLE_STRING_ANNOTATION)