summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorViktor Szakats <commit@vsz.me>2022-10-06 15:30:13 +0000
committerViktor Szakats <commit@vsz.me>2022-10-06 15:30:13 +0000
commit0c327464caa0a2d799145bab546f89ebb559ec09 (patch)
tree10949f04ae4bd66452b2003295155ec2cae6c6a5 /CMakeLists.txt
parent6d90308a39dd5ca699cb9db6d73f687b7639a340 (diff)
downloadcurl-0c327464caa0a2d799145bab546f89ebb559ec09.tar.gz
tidy-up: delete parallel/unused feature flags
Detecting headers and lib separately makes sense when headers come in variations or with extra ones, but this wasn't the case here. These were duplicate/parallel macros that we had to keep in sync with each other for a working build. This patch leaves a single macro for each of these dependencies: - Rely on `HAVE_LIBZ`, delete parallel `HAVE_ZLIB_H`. Also delete CMake logic making sure these two were in sync, along with a toggle to turn off that logic, called `CURL_SPECIAL_LIBZ`. Also delete stray `HAVE_ZLIB` defines. There is also a `USE_ZLIB` variant in `lib/config-dos.h`. This patch retains it for compatibility and deprecates it. - Rely on `USE_LIBSSH2`, delete parallel `HAVE_LIBSSH2_H`. Also delete `LIBSSH2_WIN32`, `LIBSSH2_LIBRARY` from `winbuild/MakefileBuild.vc`, these have a role when building libssh2 itself. And `CURL_USE_LIBSSH`, which had no use at all. Also delete stray `HAVE_LIBSSH2` defines. - Rely on `USE_LIBSSH`, delete parallel `HAVE_LIBSSH_LIBSSH_H`. Also delete `LIBSSH_WIN32`, `LIBSSH_LIBRARY` and `HAVE_LIBSSH` from `winbuild/MakefileBuild.vc`, these were the result of copy-pasting the libssh2 line, and were not having any use. - Delete unused `HAVE_LIBPSL_H` and `HAVE_LIBPSL`. Reviewed-by: Daniel Stenberg Closes #9652
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt37
1 files changed, 1 insertions, 36 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7fa6569d8..4cb983750 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -678,11 +678,9 @@ if(WIN32)
endif()
set(HAVE_LIBZ OFF)
-set(HAVE_ZLIB_H OFF)
set(USE_ZLIB OFF)
optional_dependency(ZLIB)
if(ZLIB_FOUND)
- set(HAVE_ZLIB_H ON)
set(HAVE_LIBZ ON)
set(USE_ZLIB ON)
@@ -730,24 +728,14 @@ endif()
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()
@@ -755,38 +743,27 @@ endif()
option(CURL_USE_LIBSSH2 "Use libSSH2" ON)
mark_as_advanced(CURL_USE_LIBSSH2)
set(USE_LIBSSH2 OFF)
-set(HAVE_LIBSSH2 OFF)
-set(HAVE_LIBSSH2_H OFF)
if(CURL_USE_LIBSSH2)
find_package(LibSSH2)
if(LIBSSH2_FOUND)
list(APPEND CURL_LIBS ${LIBSSH2_LIBRARY})
- set(CMAKE_REQUIRED_LIBRARIES ${LIBSSH2_LIBRARY})
list(APPEND CMAKE_REQUIRED_INCLUDES "${LIBSSH2_INCLUDE_DIR}")
include_directories("${LIBSSH2_INCLUDE_DIR}")
- set(HAVE_LIBSSH2 ON)
set(USE_LIBSSH2 ON)
-
- # find_package has already found the headers
- set(HAVE_LIBSSH2_H ON)
- set(CURL_INCLUDES ${CURL_INCLUDES} "${LIBSSH2_INCLUDE_DIR}/libssh2.h")
- set(CURL_TEST_DEFINES "${CURL_TEST_DEFINES} -DHAVE_LIBSSH2_H")
- unset(CMAKE_REQUIRED_LIBRARIES)
endif()
endif()
# libssh
option(CURL_USE_LIBSSH "Use libSSH" OFF)
mark_as_advanced(CURL_USE_LIBSSH)
-if(NOT HAVE_LIBSSH2 AND CURL_USE_LIBSSH)
+if(NOT USE_LIBSSH2 AND CURL_USE_LIBSSH)
find_package(libssh CONFIG)
if(libssh_FOUND)
message(STATUS "Found libssh ${libssh_VERSION}")
# Use imported target for include and library paths.
list(APPEND CURL_LIBS ssh)
set(USE_LIBSSH ON)
- set(HAVE_LIBSSH_LIBSSH_H 1)
endif()
endif()
@@ -1236,18 +1213,6 @@ if(NOT HAVE_IN_ADDR_T)
set(in_addr_t "unsigned long")
endif()
-# Fix libz / zlib.h
-
-if(NOT CURL_SPECIAL_LIBZ)
- if(NOT HAVE_LIBZ)
- set(HAVE_ZLIB_H 0)
- endif()
-
- if(NOT HAVE_ZLIB_H)
- set(HAVE_LIBZ 0)
- endif()
-endif()
-
# Check for nonblocking
set(HAVE_DISABLED_NONBLOCKING 1)
if(HAVE_FIONBIO OR