Skip to content

Commit

Permalink
CMake: Enable use of external msquic (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
dg0yt authored Dec 31, 2024
1 parent d8063e6 commit 967c4d5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
20 changes: 13 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,21 @@ else()
add_subdirectory(ls-qpack)
endif()

# Configure and build msquic dependency.
if (WIN32)
set(QUIC_TLS "schannel" CACHE STRING "TLS Library to use")
# msquic dependency
option(MSH3_USE_EXTERNAL_MSQUIC "Use an external msquic installation")
if(MSH3_USE_EXTERNAL_MSQUIC)
find_package(msquic CONFIG REQUIRED)
else()
set(QUIC_TLS "openssl" CACHE STRING "TLS Library to use")
# Configure and build
if (WIN32)
set(QUIC_TLS "schannel" CACHE STRING "TLS Library to use")
else()
set(QUIC_TLS "openssl" CACHE STRING "TLS Library to use")
endif()
set(QUIC_BUILD_SHARED ON CACHE BOOL "Builds MsQuic as a dynamic library")
set(QUIC_ENABLE_LOGGING ON CACHE BOOL "Enable MsQuic logging")
add_subdirectory(msquic)
endif()
set(QUIC_BUILD_SHARED ON CACHE BOOL "Builds MsQuic as a dynamic library")
set(QUIC_ENABLE_LOGGING ON CACHE BOOL "Enable MsQuic logging")
add_subdirectory(msquic)

# Build msh3 library (and cmd line tool).
add_subdirectory(lib)
Expand Down
3 changes: 3 additions & 0 deletions lib/msh3-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ if(NOT "@BUILD_SHARED_LIBS@")
if("@MSH3_USE_EXTERNAL_LSQPACK@")
find_dependency(ls-qpack CONFIG)
endif()
if("@MSH3_USE_EXTERNAL_MSQUIC@")
find_dependency(msquic CONFIG)
endif()
endif()

include("${CMAKE_CURRENT_LIST_DIR}/msh3.cmake")

0 comments on commit 967c4d5

Please sign in to comment.