1
0
mirror of synced 2025-04-19 00:24:02 +03:00

Fix regression of #2121 (#2126)

This commit is contained in:
Alexey Sokolov 2025-04-08 21:08:41 +01:00 committed by GitHub
parent 9e4aed482e
commit caf7c55785
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,7 +39,25 @@ if(@HTTPLIB_IS_USING_BROTLI@)
endif()
if(@HTTPLIB_IS_USING_ZSTD@)
find_dependency(zstd)
set(httplib_fd_zstd_quiet_arg)
if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
set(httplib_fd_zstd_quiet_arg QUIET)
endif()
set(httplib_fd_zstd_required_arg)
if(${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED)
set(httplib_fd_zstd_required_arg REQUIRED)
endif()
find_package(zstd QUIET)
if(NOT zstd_FOUND)
find_package(PkgConfig ${httplib_fd_zstd_quiet_arg} ${httplib_fd_zstd_required_arg})
if(PKG_CONFIG_FOUND)
pkg_check_modules(zstd ${httplib_fd_zstd_quiet_arg} ${httplib_fd_zstd_required_arg} IMPORTED_TARGET libzstd)
if(TARGET PkgConfig::zstd)
add_library(zstd::libzstd ALIAS PkgConfig::zstd)
endif()
endif()
endif()
set(httplib_zstd_FOUND ${zstd_FOUND})
endif()