cmake: add libpsl support

Fixes #8865
Closes #8867
This commit is contained in:
Vincent Torri 2022-05-19 15:29:54 +02:00 committed by Daniel Stenberg
parent 9accb9a5be
commit ee52bead4d
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
4 changed files with 78 additions and 0 deletions

View file

@ -742,6 +742,31 @@ if(CURL_ZSTD)
endif()
endif()
#libpsl
option(CURL_USE_LIBPSL "Use libPSL" ON)
mark_as_advanced(CURL_USE_LIBPSL)
set(USE_LIBPSL OFF)
set(HAVE_LIBPSL OFF)
set(HAVE_LIBSPSL_H OFF)
if(CURL_USE_LIBPSL)
find_package(LibPSL)
if(LIBPSL_FOUND)
list(APPEND CURL_LIBS ${LIBPSL_LIBRARY})
set(CMAKE_REQUIRED_LIBRARIES ${LIBPSL_LIBRARY})
list(APPEND CMAKE_REQUIRED_INCLUDES "${LIBPSL_INCLUDE_DIR}")
include_directories("${LIBPSL_INCLUDE_DIR}")
set(HAVE_LIBPSL ON)
set(USE_LIBPSL ON)
# find_package has already found the headers
set(HAVE_LIBPSL_H ON)
set(CURL_INCLUDES ${CURL_INCLUDES} "${LIBPSL_INCLUDE_DIR}/libpsl.h")
set(CURL_TEST_DEFINES "${CURL_TEST_DEFINES} -DHAVE_LIBPSL_H")
unset(CMAKE_REQUIRED_LIBRARIES)
endif()
endif()
#libSSH2
option(CURL_USE_LIBSSH2 "Use libSSH2" ON)
mark_as_advanced(CURL_USE_LIBSSH2)