Skip to content

Commit

Permalink
Refactor:
Browse files Browse the repository at this point in the history
- Add namespace
- Add MsQuicEtw.h to include header
- Refactor platform unittest external cmake
  • Loading branch information
talregev committed Dec 7, 2024
1 parent d22ec11 commit cdb0be1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-reuse-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,8 @@ if(WIN32)
add_custom_target(MsQuicEtw_HeaderBuild
DEPENDS ${QUIC_BUILD_DIR}/inc/MsQuicEtw.h)

install(FILES ${QUIC_BUILD_DIR}/inc/MsQuicEtw.h DESTINATION include)

set_property(TARGET MsQuicEtw_HeaderBuild PROPERTY FOLDER "${QUIC_FOLDER_PREFIX}helpers")

add_library(MsQuicEtw_Header INTERFACE)
Expand Down
2 changes: 1 addition & 1 deletion src/bin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 3 additions & 10 deletions src/platform/unittest/external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -28,11 +25,7 @@ set(SOURCES
../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 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)
target_link_libraries(msquicplatformtest PRIVATE gtest msquic::msquic msquic::msquic_platform ws2_32 ntdll ncrypt crypt32 iphlpapi)
target_compile_definitions(msquicplatformtest PRIVATE _DISABLE_STRING_ANNOTATION)

0 comments on commit cdb0be1

Please sign in to comment.