Skip to content

Commit

Permalink
cpp-httplib: add version 0.18.2 (conan-io#26089)
Browse files Browse the repository at this point in the history
Co-authored-by: Abril Rincón Blanco <[email protected]>
  • Loading branch information
toge and AbrilRBS authored Dec 3, 2024
1 parent 45cea81 commit e67986b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 33 deletions.
3 changes: 3 additions & 0 deletions recipes/cpp-httplib/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"0.18.2":
url: "https://github.com/yhirose/cpp-httplib/archive/v0.18.2.tar.gz"
sha256: "7dc9be587e7432b75a892832df33d6819460b5462ccd59fc462ba012fef5bf72"
"0.18.1":
url: "https://github.com/yhirose/cpp-httplib/archive/v0.18.1.tar.gz"
sha256: "405abd8170f2a446fc8612ac635d0db5947c0d2e156e32603403a4496255ff00"
Expand Down
25 changes: 17 additions & 8 deletions recipes/cpp-httplib/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
from conan.tools.build import check_min_cppstd
from conan.tools.files import copy, get
from conan.tools.layout import basic_layout
from conan.tools.scm import Version
import os

required_conan_version = ">=1.50.0"
required_conan_version = ">=2.1"


class CpphttplibConan(ConanFile):
Expand All @@ -20,17 +21,27 @@ class CpphttplibConan(ConanFile):
"with_openssl": [True, False],
"with_zlib": [True, False],
"with_brotli": [True, False],
"use_macos_keychain_certs": [True, False],
}
default_options = {
"with_openssl": False,
"with_zlib": False,
"with_brotli": False,
"use_macos_keychain_certs": True,
}
no_copy_source = True

def config_options(self):
if self.settings.os != "Macos":
del self.options.use_macos_keychain_certs

def requirements(self):
if self.options.with_openssl:
self.requires("openssl/[>=1.1 <4]")
if Version(self.version) < "0.15":
self.requires("openssl/[>=1.1 <4]")
else:
# New version of httplib.h requires OpenSSL 3
self.requires("openssl/[>=3 <4]")
if self.options.with_zlib:
self.requires("zlib/[>=1.2.11 <2]")
if self.options.with_brotli:
Expand All @@ -40,8 +51,7 @@ def package_id(self):
self.info.clear()

def validate(self):
if self.settings.compiler.get_safe("cppstd"):
check_min_cppstd(self, 11)
check_min_cppstd(self, 11)

def layout(self):
basic_layout(self, src_folder="src")
Expand Down Expand Up @@ -69,7 +79,6 @@ def package_info(self):
self.cpp_info.system_libs = ["pthread"]
elif self.settings.os == "Windows":
self.cpp_info.system_libs = ["crypt32", "cryptui", "ws2_32"]

# TODO: to remove in conan v2 once legacy generators removed
self.cpp_info.names["cmake_find_package"] = "httplib"
self.cpp_info.names["cmake_find_package_multi"] = "httplib"
elif self.settings.os == "Macos" and self.options.with_openssl and self.options.get_safe("use_macos_keychain_certs"):
self.cpp_info.frameworks = ["CoreFoundation", "Security"]
self.cpp_info.defines.append("CPPHTTPLIB_USE_CERTS_FROM_MACOSX_KEYCHAIN")
8 changes: 0 additions & 8 deletions recipes/cpp-httplib/all/test_v1_package/CMakeLists.txt

This file was deleted.

17 changes: 0 additions & 17 deletions recipes/cpp-httplib/all/test_v1_package/conanfile.py

This file was deleted.

2 changes: 2 additions & 0 deletions recipes/cpp-httplib/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"0.18.2":
folder: all
"0.18.1":
folder: all
"0.18.0":
Expand Down

0 comments on commit e67986b

Please sign in to comment.