-
Notifications
You must be signed in to change notification settings - Fork 7.5k
[ms-quic] create a new port #18225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
[ms-quic] create a new port #18225
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
79d796c
[ms-quic] create a new port
luncliff cc3223b
[ms-quic] update port/version SHA
luncliff 6b397e9
[ms-quic] disable windows-static triplet
luncliff 3e21713
Update ports/ms-quic/vcpkg.json
luncliff 17de303
Update ports/ms-quic/vcpkg.json
luncliff eebb5f5
[ms-quic] update patch files
luncliff 2ecb24d
[ms-quic] make quictls only
luncliff File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| index 96ea265..87eaed5 100644 | ||
| --- a/CMakeLists.txt | ||
| +++ b/CMakeLists.txt | ||
| @@ -647,6 +647,8 @@ if(QUIC_CODE_CHECK) | ||
| endif() | ||
| endif() | ||
|
|
||
| +include(GNUInstallDirs) | ||
| + | ||
| add_subdirectory(src/inc) | ||
|
|
||
| # Product code | ||
| @@ -657,6 +659,8 @@ add_subdirectory(src/bin) | ||
| # Tool code | ||
| if(QUIC_BUILD_TOOLS) | ||
| add_subdirectory(src/tools) | ||
| + install(TARGETS quicattack quicinterop quicinteropserver quicipclient quicipserver | ||
| + quicpcp quicping quicpost quicreach quicsample spinquic) | ||
| endif() | ||
|
|
||
| # Performance code | ||
| diff --git a/src/bin/CMakeLists.txt b/src/bin/CMakeLists.txt | ||
| index 4dda469..2797670 100644 | ||
| --- a/src/bin/CMakeLists.txt | ||
| +++ b/src/bin/CMakeLists.txt | ||
| @@ -29,7 +29,7 @@ endif() | ||
|
|
||
| target_include_directories(msquic PUBLIC | ||
| $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../inc> | ||
| - $<INSTALL_INTERFACE:${include_dest}>) | ||
| + $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>) | ||
|
|
||
| set(PUBLIC_HEADERS | ||
| ../inc/msquic.h | ||
| @@ -37,14 +37,17 @@ set(PUBLIC_HEADERS | ||
| ../inc/msquic_posix.h | ||
| ../inc/quic_sal_stub.h) | ||
|
|
||
| -install(TARGETS msquic EXPORT msquic DESTINATION "${main_lib_dest}") | ||
| -install(FILES ${PUBLIC_HEADERS} DESTINATION "${include_dest}") | ||
| +install(TARGETS msquic EXPORT msquic-targets | ||
| + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
| + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
| + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) | ||
| +install(FILES ${PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) | ||
|
|
||
| configure_file(msquic-config.cmake.in ${CMAKE_BINARY_DIR}/msquic-config.cmake) | ||
|
|
||
| -install(FILES ${CMAKE_BINARY_DIR}/msquic-config.cmake DESTINATION ${msquic_dest}) | ||
| +install(FILES ${CMAKE_BINARY_DIR}/msquic-config.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/msquic) | ||
|
|
||
| -install(EXPORT msquic DESTINATION ${msquic_dest}) | ||
| +install(EXPORT msquic-targets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/msquic) | ||
|
|
||
| if(WIN32) | ||
| add_library(msquic.lttng INTERFACE) | ||
| diff --git a/src/bin/msquic-config.cmake.in b/src/bin/msquic-config.cmake.in | ||
| index dd67624..c561361 100644 | ||
| --- a/src/bin/msquic-config.cmake.in | ||
| +++ b/src/bin/msquic-config.cmake.in | ||
| @@ -1,4 +1,4 @@ | ||
| include(CMakeFindDependencyMacro) | ||
| @FILENAME_DEP_REPLACE@ | ||
|
|
||
| -include(${SELF_DIR}/msquic.cmake) | ||
| +include(${SELF_DIR}/msquic-targets.cmake) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| index 0b670cf..f94f4c6 100644 | ||
| --- a/CMakeLists.txt | ||
| +++ b/CMakeLists.txt | ||
| @@ -309,7 +309,7 @@ if(WIN32) | ||
| endif() | ||
| else() | ||
| # Just doing a normal build. Use the PGD file if present. | ||
| - if(EXISTS "${QUIC_PGO_FILE}") | ||
| + if(FALSE) | ||
| message(STATUS "Using profile-guided optimization") | ||
| configure_file("${QUIC_PGO_FILE}" "${QUIC_OUTPUT_DIR}/msquic.pgd" COPYONLY) | ||
| set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /USEPROFILE:PGD=${QUIC_OUTPUT_DIR}/msquic.pgd") | ||
| @@ -387,21 +387,29 @@ endif() | ||
| if(QUIC_TLS STREQUAL "openssl") | ||
| if (WIN32) | ||
| if (QUIC_UWP_BUILD) | ||
| - message(FATAL_ERROR "UWP is not supported with OpenSSL") | ||
| - endif() | ||
| - | ||
| - if (${CMAKE_GENERATOR_PLATFORM} STREQUAL "arm64") | ||
| - set(QUIC_OPENSSL_WIN_ARCH "VC-WIN64-ARM") | ||
| - elseif (${CMAKE_GENERATOR_PLATFORM} STREQUAL "arm") | ||
| - set(QUIC_OPENSSL_WIN_ARCH "VC-WIN32-ARM") | ||
| - elseif (${CMAKE_GENERATOR_PLATFORM} STREQUAL "Win32") | ||
| - set(QUIC_OPENSSL_WIN_ARCH "VC-WIN32") | ||
| - elseif (${CMAKE_GENERATOR_PLATFORM} STREQUAL "x64") | ||
| - set(QUIC_OPENSSL_WIN_ARCH "VC-WIN64A") | ||
| + if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") | ||
| + set(QUIC_OPENSSL_WIN_ARCH "VC-WIN64-ARM") | ||
| + elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") | ||
| + set(QUIC_OPENSSL_WIN_ARCH "VC-WIN32-ARM") | ||
| + elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") | ||
| + set(QUIC_OPENSSL_WIN_ARCH "VC-WIN32-ONECORE") | ||
| + elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") | ||
| + set(QUIC_OPENSSL_WIN_ARCH "VC-WIN64A-ONECORE") | ||
| + endif() | ||
| else() | ||
| - message(FATAL_ERROR "Unknown Generator Platform ${CMAKE_GENERATOR_PLATFORM}") | ||
| + if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") | ||
| + set(QUIC_OPENSSL_WIN_ARCH "VC-WIN64-ARM") | ||
| + elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") | ||
| + set(QUIC_OPENSSL_WIN_ARCH "VC-WIN32-ARM") | ||
| + elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") | ||
| + set(QUIC_OPENSSL_WIN_ARCH "VC-WIN32") | ||
| + elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") | ||
| + set(QUIC_OPENSSL_WIN_ARCH "VC-WIN64A") | ||
| + endif() | ||
| + endif() | ||
| + if(NOT DEFINED QUIC_OPENSSL_WIN_ARCH) | ||
| + message(FATAL_ERROR "Unknown Platform ${VCPKG_TARGET_ARCHITECTURE}") | ||
| endif() | ||
| - | ||
| set(OPENSSL_DIR ${QUIC_BUILD_DIR}/openssl) | ||
|
|
||
| add_library(OpenSSL_Crypto STATIC IMPORTED) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| index 0f5abcb..aeae310 100644 | ||
| --- a/CMakeLists.txt | ||
| +++ b/CMakeLists.txt | ||
| @@ -184,7 +184,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${QUIC_OUTPUT_DIR}) | ||
| set(QUIC_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/inc) | ||
|
|
||
| if (WIN32) | ||
| - set(QUIC_WARNING_FLAGS /WX /W4 /sdl CACHE INTERNAL "") | ||
| + set(QUIC_WARNING_FLAGS /W4 /sdl CACHE INTERNAL "") | ||
| set(QUIC_COMMON_FLAGS "") | ||
| if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") | ||
| list(APPEND QUIC_COMMON_FLAGS /MP) | ||
| @@ -193,7 +193,7 @@ if (WIN32) | ||
| else() | ||
| set(QUIC_COMMON_FLAGS "") | ||
| set(QUIC_COMMON_DEFINES _GNU_SOURCE) | ||
| - set(QUIC_WARNING_FLAGS -Werror -Wall -Wextra -Wformat=2 -Wno-type-limits | ||
| + set(QUIC_WARNING_FLAGS -Wall -Wextra -Wformat=2 -Wno-type-limits | ||
| -Wno-unknown-pragmas -Wno-multichar -Wno-missing-field-initializers | ||
| CACHE INTERNAL "") | ||
| if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) | ||
|
|
||
| vcpkg_from_github( | ||
| OUT_SOURCE_PATH QUIC_SOURCE_PATH | ||
| REPO microsoft/msquic | ||
| REF v1.2.0 | ||
| SHA512 6f63d42d950cbba88764332b31818a8627e7d3ecf7393cdef77daedd35a7bb04ac39c642991afb7cca502a346999233023e3b36011916c67e348179838aa7042 | ||
| HEAD_REF master | ||
| PATCHES | ||
| fix-warnings.patch # Remove /WX, -Werror | ||
| fix-platform.patch # Make OpenSSL build use VCPKG_TARGET_ARCHITECTURE | ||
| fix-install.patch # Adjust install path of build outputs | ||
| ) | ||
|
|
||
| vcpkg_from_github( | ||
| OUT_SOURCE_PATH OPENSSL_SOURCE_PATH | ||
| REPO quictls/openssl | ||
| REF a6e9d76db343605dae9b59d71d2811b195ae7434 | ||
| SHA512 23510a11203b96476c194a1987c7d4e758375adef0f6dfe319cd8ec4b8dd9b12ea64c4099cf3ba35722b992dad75afb1cfc5126489a5fa59f5ee4d46bdfbeaf6 | ||
| HEAD_REF OpenSSL_1_1_1k+quic | ||
| ) | ||
| file(REMOVE_RECURSE ${QUIC_SOURCE_PATH}/submodules) | ||
| file(MAKE_DIRECTORY ${QUIC_SOURCE_PATH}/submodules) | ||
| file(RENAME ${OPENSSL_SOURCE_PATH} ${QUIC_SOURCE_PATH}/submodules/openssl) | ||
|
|
||
| vcpkg_find_acquire_program(PERL) | ||
| get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY) | ||
| vcpkg_add_to_path(${PERL_EXE_PATH}) | ||
|
|
||
| if(NOT VCPKG_HOST_IS_WINDOWS) | ||
| find_program(MAKE make) | ||
| get_filename_component(MAKE_EXE_PATH ${MAKE} DIRECTORY) | ||
| vcpkg_add_to_path(PREPEND ${MAKE_EXE_PATH}) | ||
| endif() | ||
|
|
||
| if(VCPKG_TARGET_IS_WINDOWS) | ||
| vcpkg_find_acquire_program(NASM) | ||
| get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY) | ||
| vcpkg_add_to_path(PREPEND ${NASM_EXE_PATH}) | ||
| endif() | ||
|
|
||
| vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS | ||
| FEATURES | ||
| tools QUIC_BUILD_TOOLS | ||
| ) | ||
|
|
||
| string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATIC_CRT) | ||
|
|
||
| vcpkg_cmake_configure( | ||
| SOURCE_PATH ${QUIC_SOURCE_PATH} | ||
| OPTIONS | ||
| ${FEATURE_OPTIONS} | ||
| -DQUIC_SOURCE_LINK=OFF | ||
| -DQUIC_TLS=openssl | ||
| -DQUIC_TLS_SECRETS_SUPPORT=ON | ||
| -DQUIC_USE_SYSTEM_LIBCRYPTO=OFF | ||
| -DQUIC_BUILD_PERF=OFF | ||
| -DQUIC_BUILD_TEST=OFF | ||
| -DQUIC_STATIC_LINK_CRT=${STATIC_CRT} | ||
| -DQUIC_UWP_BUILD=${VCPKG_TARGET_IS_UWP} | ||
| ) | ||
|
|
||
| vcpkg_cmake_build(TARGET OpenSSL_Build) # separate build log for quictls/openssl | ||
| vcpkg_cmake_install() | ||
| vcpkg_copy_pdbs() | ||
| vcpkg_cmake_config_fixup(PACKAGE_NAME msquic CONFIG_PATH lib/cmake/msquic) | ||
|
|
||
| if("tools" IN_LIST FEATURES) | ||
| vcpkg_copy_tools(TOOL_NAMES quicattack quicinterop quicinteropserver quicipclient quicipserver | ||
| quicpcp quicping quicpost quicreach quicsample spinquic | ||
| AUTO_CLEAN | ||
| ) | ||
| endif() | ||
|
|
||
| file(INSTALL ${QUIC_SOURCE_PATH}/LICENSE | ||
| DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright | ||
| ) | ||
| file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share | ||
| ${CURRENT_PACKAGES_DIR}/debug/include | ||
| ) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "name": "ms-quic", | ||
| "version": "1.2.0", | ||
| "description": "Cross-platform, C implementation of the IETF QUIC protocol", | ||
| "homepage": "https://github.com/microsoft/msquic", | ||
| "license": "MIT", | ||
| "supports": "!(static & staticcrt)", | ||
| "dependencies": [ | ||
| { | ||
| "name": "vcpkg-cmake", | ||
| "host": true | ||
| }, | ||
| { | ||
| "name": "vcpkg-cmake-config", | ||
| "host": true | ||
| } | ||
| ], | ||
| "features": { | ||
| "tools": { | ||
| "description": "Install the tools after build" | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "versions": [ | ||
| { | ||
| "git-tree": "3188e024233a7d1772922bc11d29d912c6427e25", | ||
| "version": "1.2.0", | ||
| "port-version": 0 | ||
| } | ||
| ] | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.