[ls-qpack] Update to latest version and fix build error (#41186)

Co-authored-by: Jon <v-zhli17@microsoft.com>
This commit is contained in:
JonLiu1993 2024-10-01 01:12:25 +08:00 коммит произвёл GitHub
Родитель 13ca70c498
Коммит 4d93d45dae
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
9 изменённых файлов: 21 добавлений и 79 удалений

Просмотреть файл

@ -1,46 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 56c3e23..7a4a2d6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,7 +17,10 @@ option(LSQPACK_XXH "Include XXH" ON)
# Use `cmake -DBUILD_SHARED_LIBS=OFF` to build a static library.
add_library(ls-qpack "")
-target_include_directories(ls-qpack PUBLIC .)
+target_include_directories(ls-qpack PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+ $<INSTALL_INTERFACE:include>
+)
target_sources(ls-qpack PRIVATE lsqpack.c)
if(LSQPACK_XXH)
@@ -30,7 +33,10 @@ else()
endif()
if(WIN32)
- target_include_directories(ls-qpack PUBLIC wincompat)
+ target_include_directories(ls-qpack PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/wincompat>
+ $<INSTALL_INTERFACE:include>
+ )
endif()
if(MSVC)
@@ -106,7 +112,16 @@ if(LSQPACK_BIN)
add_subdirectory(bin)
endif()
-install(TARGETS ls-qpack)
+install(TARGETS ls-qpack EXPORT unofficial-ls-qpack-config
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib
+)
+install(
+ EXPORT unofficial-ls-qpack-config
+ NAMESPACE unofficial::ls-qpack::
+ DESTINATION share/unofficial-ls-qpack
+)
install(FILES lsqpack.h lsxpack_header.h DESTINATION include)
if(WIN32)
install(DIRECTORY wincompat/sys DESTINATION include)

Просмотреть файл

@ -6,11 +6,8 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO litespeedtech/ls-qpack
REF "v${VERSION}"
SHA512 7677f673b4b23a68ad5e899706f17536777b30d7e91c63d3ea97504a6a2885cf7f431c191ac0581631723151050f914ec31bcb84e2b6e3fcdf4140cde0a18063
SHA512 74d4b2ea96bf0de43009cc121c8e57caff83be53c613236b01dce4ac4c12505d0d9fec07d9152ca62166947a160de2ab3f7bf19fb203a60b44507516a927ecb8
HEAD_REF master
PATCHES
xxhash.patch
cmake-export.patch
)
vcpkg_find_acquire_program(PKGCONFIG)
@ -27,15 +24,15 @@ vcpkg_cmake_configure(
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-ls-qpack)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/ls-qpack)
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
)
file(READ "${CURRENT_PACKAGES_DIR}/share/unofficial-ls-qpack/unofficial-ls-qpack-config.cmake" cmake_config)
file(WRITE "${CURRENT_PACKAGES_DIR}/share/unofficial-ls-qpack/unofficial-ls-qpack-config.cmake"
file(READ "${CURRENT_PACKAGES_DIR}/share/ls-qpack/ls-qpack-config.cmake" cmake_config)
file(WRITE "${CURRENT_PACKAGES_DIR}/share/ls-qpack/ls-qpack-config.cmake"
"include(CMakeFindDependencyMacro)
find_dependency(PkgConfig)
pkg_check_modules(XXH REQUIRED IMPORTED_TARGET libxxhash)

Просмотреть файл

@ -1,7 +1,6 @@
{
"name": "ls-qpack",
"version": "2.5.4",
"port-version": 3,
"version": "2.5.5",
"description": "QPACK compression library for use with HTTP/3",
"homepage": "https://github.com/litespeedtech/ls-qpack",
"license": "MIT",

Просмотреть файл

@ -1,19 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1a1f8e9..56c3e23 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,9 +20,13 @@ add_library(ls-qpack "")
target_include_directories(ls-qpack PUBLIC .)
target_sources(ls-qpack PRIVATE lsqpack.c)
-target_include_directories(ls-qpack PRIVATE deps/xxhash/)
if(LSQPACK_XXH)
target_sources(ls-qpack PRIVATE deps/xxhash/xxhash.c)
+else()
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(XXH REQUIRED IMPORTED_TARGET libxxhash)
+ target_link_libraries(ls-qpack PUBLIC PkgConfig::XXH)
+ set(LSQPACK_DEPENDS "libxxhash")
endif()
if(WIN32)

Просмотреть файл

@ -7,7 +7,7 @@ index 4bd7155..b7adecc 100644
option(LSQPACK_TESTS "Build tests" OFF)
option(LSQPACK_BIN "Build binaries" OFF)
-add_subdirectory(ls-qpack)
+find_package(unofficial-ls-qpack CONFIG REQUIRED)
+find_package(ls-qpack CONFIG REQUIRED)
# Configure and build msquic dependency.
if (WIN32)
@ -35,7 +35,7 @@ index ab7fc24..c488486 100644
-if (NOT BUILD_SHARED_LIBS)
- target_link_libraries(msh3 PRIVATE base_link)
-endif()
+target_link_libraries(msh3 PRIVATE msquic unofficial::ls-qpack::ls-qpack msh3_headers)
+target_link_libraries(msh3 PRIVATE msquic ls-qpack::ls-qpack msh3_headers)
if (MSH3_SERVER_SUPPORT)
target_link_libraries(msh3 PRIVATE platform) # For selfsign APIs
endif()

Просмотреть файл

@ -1,6 +1,7 @@
{
"name": "msh3",
"version": "0.6.0",
"port-version": 1,
"description": "Minimal HTTP/3 library",
"homepage": "https://github.com/nibanks/msh3",
"license": "MIT",

Просмотреть файл

@ -5565,8 +5565,8 @@
"port-version": 1
},
"ls-qpack": {
"baseline": "2.5.4",
"port-version": 3
"baseline": "2.5.5",
"port-version": 0
},
"ltla-aarand": {
"baseline": "2023-03-19",
@ -6094,7 +6094,7 @@
},
"msh3": {
"baseline": "0.6.0",
"port-version": 0
"port-version": 1
},
"msinttypes": {
"baseline": "2018-02-25",

Просмотреть файл

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "73e7312699ae28db63ff0171b70283b694c46bd7",
"version": "2.5.5",
"port-version": 0
},
{
"git-tree": "c8b9ac167ce7e831b1434cff6f3da33cdcee974d",
"version": "2.5.4",

Просмотреть файл

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "6c26630aa357e123fe98a2dd4359b52681333a81",
"version": "0.6.0",
"port-version": 1
},
{
"git-tree": "1621424c690e4de0daaac921e92fc0c06ace9677",
"version": "0.6.0",