Skip to content
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

[msh3] Sync patches and upstream [skip actions] #43018

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
100 changes: 0 additions & 100 deletions ports/msh3/dependencies_fix.patch

This file was deleted.

16 changes: 16 additions & 0 deletions ports/msh3/msquic-targets.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 1b2a33d..228bf5d 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -16,9 +16,9 @@ target_include_directories(msh3 PUBLIC
$<BUILD_INTERFACE:${msh3_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>
)
-target_link_libraries(msh3 PRIVATE msquic msquic_platform ls-qpack::ls-qpack)
+target_link_libraries(msh3 PRIVATE msquic::msquic msquic::platform ls-qpack::ls-qpack)
if (NOT BUILD_SHARED_LIBS)
- target_link_libraries(msh3 PRIVATE base_link)
+ target_link_libraries(msh3 PRIVATE msquic::base_link)
endif()

if(WIN32)
14 changes: 9 additions & 5 deletions ports/msh3/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,27 @@ vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO nibanks/msh3
REF v${VERSION}
SHA512 dedd8be43e44b4bebbf601d76b1f3b0135501330ed128ca710de942ef7d9142a21f1c1eb9efecf57881e72d93d68c7c2c085bc35d402eac5eabc57e77773be6b
REF #[[ v${VERSION} ]] ba595031e093b479beaa0f410cb70405bc5fd067
SHA512 e882079ab7996c458af8af9c5d828172217591832621bd2a4353a6a6821dc16cf221253a3041e42e94bf9972bcd6a812d8fbe8eb1a02c84cb21cd95edf29fe66
HEAD_REF main
PATCHES
dependencies_fix.patch
width-exceeds-type.diff
win32-crt.diff
msquic-targets.diff
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DMSH3_INSTALL_PKGCONFIG=ON
-DMSH3_USE_EXTERNAL_LSQPACK=ON
-DMSH3_USE_EXTERNAL_MSQUIC=ON
)

vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()
vcpkg_cmake_config_fixup()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
32 changes: 0 additions & 32 deletions ports/msh3/width-exceeds-type.diff

This file was deleted.

14 changes: 14 additions & 0 deletions ports/msh3/win32-crt.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4e67640..d95e8c8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -36,9 +36,6 @@ set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

if (WIN32)
- # Statically link the OS included part of the runtime.
- set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
- set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib")

add_compile_definitions(WIN32_LEAN_AND_MEAN)
if(HAS_SPECTRE)
56 changes: 0 additions & 56 deletions ports/msquic/exports-for-msh3.diff

This file was deleted.

12 changes: 2 additions & 10 deletions ports/msquic/fix-install.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,12 @@ diff --git a/src/bin/CMakeLists.txt b/src/bin/CMakeLists.txt
index 18048e3..4fcd161 100644
--- a/src/bin/CMakeLists.txt
+++ b/src/bin/CMakeLists.txt
@@ -11,6 +11,7 @@ endif()

if(BUILD_SHARED_LIBS)
add_library(msquic SHARED ${SOURCES})
+ target_include_directories(msquic PUBLIC $<INSTALL_INTERFACE:include>)
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)
@@ -261,7 +262,10 @@ if(WIN32)
@@ -262,7 +262,10 @@ if(WIN32)
endif()

if(BUILD_SHARED_LIBS)
- install(TARGETS msquic msquic_platform inc logging_inc warnings main_binary_link_args ${OTHER_TARGETS} EXPORT msquic DESTINATION lib)
+ install(TARGETS msquic EXPORT msquic
+ install(TARGETS msquic msquic_platform inc logging_inc warnings main_binary_link_args ${OTHER_TARGETS} EXPORT msquic
+ RUNTIME DESTINATION bin
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib)
Expand Down
6 changes: 3 additions & 3 deletions ports/msquic/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH QUIC_SOURCE_PATH
REPO microsoft/msquic
REF "v${VERSION}"
SHA512 c6e4b5f5d9b7e92469a6733a99eaf677909a5b2287869f0bbcc61fbcda6db4a6e920b327ede43fc9b1b0a3d09518c568dc1f38ad5fbb3ace14c1c031012b9968
REF #[[ "v${VERSION}" ]] 9610803b6eed56f6b8e9506f2fb8cc702195a3a2
SHA512 d83ecca5da458faf4d199cb2b695dbdc4462ee87ca60bd2af2da5f5884bd161001b1df77ce161652b195e62925032abc6c7a29cf851ea97448c0da7a4ee493f4
HEAD_REF master
PATCHES
fix-install.patch # Adjust install path of build outputs
fix-uwp-crt.patch # https://github.com/microsoft/msquic/pull/4373
fix-comparing-system-processor-with-win32.patch # https://github.com/microsoft/msquic/pull/4374
uwp-link-libs.diff
exports-for-msh3.diff
target-names.diff
)

vcpkg_from_github(
Expand Down
45 changes: 45 additions & 0 deletions ports/msquic/target-names.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
diff --git a/src/bin/CMakeLists.txt b/src/bin/CMakeLists.txt
index e69cf51ac..f9fffce61 100644
--- a/src/bin/CMakeLists.txt
+++ b/src/bin/CMakeLists.txt
@@ -11,6 +11,7 @@ endif()

if(BUILD_SHARED_LIBS)
add_library(msquic SHARED ${SOURCES})
+ add_library(msquic::msquic ALIAS msquic)
target_include_directories(msquic PUBLIC $<INSTALL_INTERFACE:include>)
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})
diff --git a/src/bin/msquic-config.cmake.in b/src/bin/msquic-config.cmake.in
index e61e63fea..f9d17c5e7 100644
--- a/src/bin/msquic-config.cmake.in
+++ b/src/bin/msquic-config.cmake.in
@@ -2,8 +2,10 @@ include(CMakeFindDependencyMacro)

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

-foreach(_t IN ITEMS msquic msquic_platform)
- if(TARGET msquic::${_t} AND NOT TARGET ${_t})
- add_library(${_t} ALIAS msquic::${_t})
- endif()
-endforeach()
+# Legacy names
+if(NOT TARGET msquic)
+ add_library(msquic ALIAS msquic::msquic)
+endif()
+if(NOT TARGET msquic_platform)
+ add_library(msquic_platform ALIAS msquic::platform)
+endif()
diff --git a/src/platform/CMakeLists.txt b/src/platform/CMakeLists.txt
index 997906d0c..61c898a8a 100644
--- a/src/platform/CMakeLists.txt
+++ b/src/platform/CMakeLists.txt
@@ -60,6 +60,8 @@ else()
endif()

add_library(msquic_platform STATIC ${SOURCES})
+add_library(msquic::platform ALIAS msquic_platform)
+set_target_properties(msquic_platform PROPERTIES EXPORT_NAME platform)

if("${CX_PLATFORM}" STREQUAL "windows")
target_link_libraries(
Loading