[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 354/411: cmake: make CURL_ZLIB a tri-state variable
From: |
gnunet |
Subject: |
[gnurl] 354/411: cmake: make CURL_ZLIB a tri-state variable |
Date: |
Wed, 13 Jan 2021 01:22:49 +0100 |
This is an automated email from the git hooks/post-receive script.
nikita pushed a commit to branch master
in repository gnurl.
commit f21cc62832a9d5c521d10da9177b075bfed43f2f
Author: Cristian Morales Vega <cristian@samknows.com>
AuthorDate: Thu Nov 19 07:54:09 2020 +0000
cmake: make CURL_ZLIB a tri-state variable
By differentiating between ON and AUTO it can make a missing zlib
library a hard error when CURL_ZLIB=ON is used.
Reviewed-by: Jakub Zakrzewski
Closes #6221
Fixes #6173
---
CMake/Macros.cmake | 11 +++++++++++
CMakeLists.txt | 33 +++++++++++++++------------------
docs/KNOWN_BUGS | 13 ++++---------
3 files changed, 30 insertions(+), 27 deletions(-)
diff --git a/CMake/Macros.cmake b/CMake/Macros.cmake
index 6c29856c4..d57dd6ad5 100644
--- a/CMake/Macros.cmake
+++ b/CMake/Macros.cmake
@@ -107,3 +107,14 @@ macro(curl_nroff_check)
message(WARNING "Found no *nroff program")
endif()
endmacro()
+
+macro(optional_dependency DEPENDENCY)
+ set(CURL_${DEPENDENCY} AUTO CACHE STRING "Build curl with ${DEPENDENCY}
support (AUTO, ON or OFF)")
+ set_property(CACHE CURL_${DEPENDENCY} PROPERTY STRINGS AUTO ON OFF)
+
+ if(CURL_${DEPENDENCY} STREQUAL AUTO)
+ find_package(${DEPENDENCY})
+ elseif(CURL_${DEPENDENCY})
+ find_package(${DEPENDENCY} REQUIRED)
+ endif()
+endmacro()
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 29c588bcd..7a2ad440b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -623,28 +623,25 @@ check_library_exists_concat("idn2" idn2_lookup_ul
HAVE_LIBIDN2)
# Check for symbol dlopen (same as HAVE_LIBDL)
check_library_exists("${CURL_LIBS}" dlopen "" HAVE_DLOPEN)
-option(CURL_ZLIB "Set to ON to enable building curl with zlib support." ON)
set(HAVE_LIBZ OFF)
set(HAVE_ZLIB_H OFF)
set(USE_ZLIB OFF)
-if(CURL_ZLIB)
- find_package(ZLIB QUIET)
- if(ZLIB_FOUND)
- set(HAVE_ZLIB_H ON)
- set(HAVE_LIBZ ON)
- set(USE_ZLIB ON)
-
- # Depend on ZLIB via imported targets if supported by the running
- # version of CMake. This allows our dependents to get our dependencies
- # transitively.
- if(NOT CMAKE_VERSION VERSION_LESS 3.4)
- list(APPEND CURL_LIBS ZLIB::ZLIB)
- else()
- list(APPEND CURL_LIBS ${ZLIB_LIBRARIES})
- include_directories(${ZLIB_INCLUDE_DIRS})
- endif()
- list(APPEND CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIRS})
+optional_dependency(ZLIB)
+if(ZLIB_FOUND)
+ set(HAVE_ZLIB_H ON)
+ set(HAVE_LIBZ ON)
+ set(USE_ZLIB ON)
+
+ # Depend on ZLIB via imported targets if supported by the running
+ # version of CMake. This allows our dependents to get our dependencies
+ # transitively.
+ if(NOT CMAKE_VERSION VERSION_LESS 3.4)
+ list(APPEND CURL_LIBS ZLIB::ZLIB)
+ else()
+ list(APPEND CURL_LIBS ${ZLIB_LIBRARIES})
+ include_directories(${ZLIB_INCLUDE_DIRS})
endif()
+ list(APPEND CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIRS})
endif()
option(CURL_BROTLI "Set to ON to enable building curl with brotli support."
OFF)
diff --git a/docs/KNOWN_BUGS b/docs/KNOWN_BUGS
index 04ada571d..c427b3fb6 100644
--- a/docs/KNOWN_BUGS
+++ b/docs/KNOWN_BUGS
@@ -129,9 +129,8 @@ problems may have been fixed or changed somewhat since this
was written!
15.6 uses -lpthread instead of Threads::Threads
15.7 generated .pc file contains strange entries
15.8 libcurl.pc uses absolute library paths
- 15.9 doesn't fail if zlib support is requested but not found
- 15.10 cert paths autodetected when cross-compiling
- 15.11 libspsl is not supported
+ 15.9 cert paths autodetected when cross-compiling
+ 15.10 libspsl is not supported
==============================================================================
@@ -887,17 +886,13 @@ problems may have been fixed or changed somewhat since
this was written!
See https://github.com/curl/curl/issues/6169
-15.9 doesn't fail if zlib support is requested but not found
-
- See https://github.com/curl/curl/issues/6173
-
-15.10 cert paths autodetected when cross-compiling
+15.9 cert paths autodetected when cross-compiling
The autotools build disables the ca_path/ca_bundle detection when
cross-compiling. The cmake build keeps doing the detection.
See https://github.com/curl/curl/issues/6178
-15.11 libspsl is not supported
+15.10 libspsl is not supported
See https://github.com/curl/curl/issues/6214
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnurl] 303/411: RELEASE-NOTES: synced, (continued)
- [gnurl] 303/411: RELEASE-NOTES: synced, gnunet, 2021/01/12
- [gnurl] 293/411: gnutls: fix memory leaks (certfields memory wasn't released), gnunet, 2021/01/12
- [gnurl] 316/411: examples: fix comment syntax, gnunet, 2021/01/12
- [gnurl] 283/411: CMake: make BUILD_TESTING dependent option, gnunet, 2021/01/12
- [gnurl] 337/411: cmake: correctly handle linker flags for static libs, gnunet, 2021/01/12
- [gnurl] 291/411: tool_operate: --retry for HTTP 408 responses too, gnunet, 2021/01/12
- [gnurl] 361/411: RELEASE-NOTES: synced, gnunet, 2021/01/12
- [gnurl] 315/411: hsts: Remove pointless call to free in errorpath, gnunet, 2021/01/12
- [gnurl] 367/411: Makefile.m32: add support for UNICODE builds, gnunet, 2021/01/12
- [gnurl] 285/411: configure: use pkgconfig to find openSSL when cross-compiling, gnunet, 2021/01/12
- [gnurl] 354/411: cmake: make CURL_ZLIB a tri-state variable,
gnunet <=
- [gnurl] 357/411: mailmap: Daniel Hwang, gnunet, 2021/01/12
- [gnurl] 265/411: CMake: store IDN2 information in curl_config.h, gnunet, 2021/01/12
- [gnurl] 351/411: KNOWN_BUGS: cmake autodetects cert paths when cross-compiling, gnunet, 2021/01/12
- [gnurl] 222/411: build-wolfssl: fix build with Visual Studio 2019, gnunet, 2021/01/12
- [gnurl] 202/411: src: Consistently spell whitespace without whitespace, gnunet, 2021/01/12
- [gnurl] 224/411: RELEASE-NOTES: synced, gnunet, 2021/01/12
- [gnurl] 277/411: range.d: fix typo, gnunet, 2021/01/12
- [gnurl] 296/411: sendf: move the verbose-check into Curl_debug, gnunet, 2021/01/12
- [gnurl] 359/411: tests/server/tftpd.c: close upload file right after transfer, gnunet, 2021/01/12
- [gnurl] 321/411: test493: verify --hsts upgrade and that %{url_effective} reflects that, gnunet, 2021/01/12