package/libcpprestsdk: zlib is optional, not mandatory
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Sat, 14 Mar 2020 22:20:26 +0000 (23:20 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sat, 25 Apr 2020 13:41:11 +0000 (15:41 +0200)
The CMakeLists.txt contains:

  if(CPPREST_EXCLUDE_COMPRESSION)
  if(NOT CPPREST_EXCLUDE_BROTLI)
  message(FATAL_ERROR "Use of Brotli requires compression to be enabled")
  endif()

libcpprestsdk requires openssl, so if the libopenssl provider is
chosen, it anyway pulls in zlib. But if libressl is used as a
provider, it doesn't pull in zlib, and building libcpprestsdk becomes
possible without zlib thanks to this patch.

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/libcpprestsdk/Config.in
package/libcpprestsdk/libcpprestsdk.mk

index 01ebc6aa7f9af8ba5d9a9f4e261da196e91b1773..af97509d1ba19e31e87562032009f2a280114320 100644 (file)
@@ -14,7 +14,6 @@ config BR2_PACKAGE_LIBCPPRESTSDK
        select BR2_PACKAGE_BOOST_REGEX
        select BR2_PACKAGE_BOOST_THREAD
        select BR2_PACKAGE_OPENSSL
-       select BR2_PACKAGE_ZLIB
        help
          The C++ REST SDK is a Microsoft project for cloud-based
          client-server communication in native code using a modern
index 8404b5096c65b0ffaac6202ab467f7084c751dec..69ff9f17ccad815b162fa19c01be85428cfa360a 100644 (file)
@@ -10,7 +10,7 @@ LIBCPPRESTSDK_LICENSE = MIT
 LIBCPPRESTSDK_LICENSE_FILES = license.txt
 LIBCPPRESTSDK_SUBDIR = Release
 LIBCPPRESTSDK_INSTALL_STAGING = YES
-LIBCPPRESTSDK_DEPENDENCIES += host-pkgconf boost openssl zlib
+LIBCPPRESTSDK_DEPENDENCIES += host-pkgconf boost openssl
 LIBCPPRESTSDK_CONF_OPTS = -DWERROR=OFF -DBUILD_SAMPLES=OFF
 
 ifeq ($(BR2_STATIC_LIBS),y)
@@ -25,12 +25,19 @@ ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
 LIBCPPRESTSDK_CXXFLAGS += -latomic
 endif
 
+ifeq ($(BR2_PACKAGE_ZLIB),y)
+LIBCPPRESTSDK_DEPENDENCIES += zlib
+LIBCPPRESTSDK_CONF_OPTS += -DCPPREST_EXCLUDE_COMPRESSION=OFF
+# brotli needs compression
 ifeq ($(BR2_PACKAGE_BROTLI),y)
 LIBCPPRESTSDK_DEPENDENCIES += brotli
 LIBCPPRESTSDK_CONF_OPTS += -DCPPREST_EXCLUDE_BROTLI=OFF
 else
 LIBCPPRESTSDK_CONF_OPTS += -DCPPREST_EXCLUDE_BROTLI=ON
 endif
+else
+LIBCPPRESTSDK_CONF_OPTS += -DCPPREST_EXCLUDE_COMPRESSION=ON
+endif
 
 ifeq ($(BR2_PACKAGE_WEBSOCKETPP),y)
 LIBCPPRESTSDK_DEPENDENCIES += websocketpp