diff --git a/recipes/redis-plus-plus/all/conanfile.py b/recipes/redis-plus-plus/all/conanfile.py index 5895ab8dac984..d7fbaf589b20b 100644 --- a/recipes/redis-plus-plus/all/conanfile.py +++ b/recipes/redis-plus-plus/all/conanfile.py @@ -2,7 +2,7 @@ from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, replace_in_file, rmdir +from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from conan.tools.scm import Version import os @@ -64,9 +64,9 @@ def layout(self): cmake_layout(self, src_folder="src") def requirements(self): - self.requires("hiredis/1.1.0", transitive_headers=True, transitive_libs=True) + self.requires("hiredis/1.2.0", transitive_headers=True, transitive_libs=True) if self.options.get_safe("build_async"): - self.requires("libuv/1.46.0") + self.requires("libuv/1.47.0") def validate(self): if self.info.settings.compiler.get_safe("cppstd"): @@ -97,18 +97,13 @@ def generate(self): tc.variables["REDIS_PLUS_PLUS_BUILD_TEST"] = False tc.variables["REDIS_PLUS_PLUS_BUILD_STATIC"] = not self.options.shared tc.variables["REDIS_PLUS_PLUS_BUILD_SHARED"] = self.options.shared - if Version(self.version) >= "1.2.3": - tc.variables["REDIS_PLUS_PLUS_BUILD_STATIC_WITH_PIC"] = self.options.shared + tc.variables["REDIS_PLUS_PLUS_BUILD_STATIC_WITH_PIC"] = self.options.shared tc.generate() deps = CMakeDeps(self) deps.generate() def _patch_sources(self): apply_conandata_patches(self) - if Version(self.version) < "1.2.3": - replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"), - "set_target_properties(${STATIC_LIB} PROPERTIES POSITION_INDEPENDENT_CODE ON)", - "") def build(self): self._patch_sources() diff --git a/recipes/redis-plus-plus/all/patches/1.2.1-0001-fix-hiredis-consumption.patch b/recipes/redis-plus-plus/all/patches/1.2.1-0001-fix-hiredis-consumption.patch deleted file mode 100644 index de2b4ddbe2f80..0000000000000 --- a/recipes/redis-plus-plus/all/patches/1.2.1-0001-fix-hiredis-consumption.patch +++ /dev/null @@ -1,62 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -29,6 +29,7 @@ if (REDIS_PLUS_PLUS_USE_TLS) - message(STATUS "Build with TLS support") - - set(TLS_SUB_DIR "${PROJECT_SOURCE_DIR}/tls") -+ find_package(hiredis REQUIRED hiredis_ssl CONFIG) - else() - set(TLS_SUB_DIR "${PROJECT_SOURCE_DIR}/no_tls") - endif() -@@ -36,8 +37,7 @@ endif() - file(GLOB TLS_SOURCE_FILES "${TLS_SUB_DIR}/*.cpp") - - # hiredis dependency --find_path(HIREDIS_HEADER hiredis) --find_library(HIREDIS_LIB hiredis) -+find_package(hiredis REQUIRED hiredis CONFIG) - - # Build static library - option(REDIS_PLUS_PLUS_BUILD_STATIC "Build static library" ON) -@@ -48,7 +48,7 @@ if (REDIS_PLUS_PLUS_BUILD_STATIC) - add_library(${STATIC_LIB} STATIC ${PROJECT_SOURCE_FILES} ${TLS_SOURCE_FILES}) - - target_include_directories(${STATIC_LIB} PUBLIC ${PROJECT_SOURCE_DIR} ${TLS_SUB_DIR}) -- target_include_directories(${STATIC_LIB} PUBLIC ${HIREDIS_HEADER}) -+ target_link_libraries(${STATIC_LIB} PUBLIC hiredis::hiredis) - - if (WIN32) - target_compile_definitions(${STATIC_LIB} PRIVATE NOMINMAX) -@@ -58,6 +58,10 @@ if (REDIS_PLUS_PLUS_BUILD_STATIC) - set_target_properties(${STATIC_LIB} PROPERTIES OUTPUT_NAME ${PROJECT_NAME}) - endif() - -+ if (REDIS_PLUS_PLUS_USE_TLS) -+ target_link_libraries(${STATIC_LIB} PUBLIC hiredis::hiredis_ssl) -+ endif() -+ - set_target_properties(${STATIC_LIB} PROPERTIES CLEAN_DIRECT_OUTPUT 1) - set_target_properties(${STATIC_LIB} PROPERTIES POSITION_INDEPENDENT_CODE ON) - endif() -@@ -71,7 +75,7 @@ if (REDIS_PLUS_PLUS_BUILD_SHARED) - add_library(${SHARED_LIB} SHARED ${PROJECT_SOURCE_FILES} ${TLS_SOURCE_FILES}) - - target_include_directories(${SHARED_LIB} PUBLIC ${PROJECT_SOURCE_DIR} ${TLS_SUB_DIR}) -- target_include_directories(${SHARED_LIB} PUBLIC ${HIREDIS_HEADER}) -+ target_link_libraries(${SHARED_LIB} PUBLIC hiredis::hiredis) - - if (WIN32) - target_compile_definitions(${SHARED_LIB} PRIVATE NOMINMAX) -@@ -79,11 +83,9 @@ if (REDIS_PLUS_PLUS_BUILD_SHARED) - set_target_properties(${SHARED_LIB} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) - endif() - -- target_link_libraries(${SHARED_LIB} ${HIREDIS_LIB}) - - if (REDIS_PLUS_PLUS_USE_TLS) -- find_library(HIREDIS_TLS_LIB hiredis_ssl) -- target_link_libraries(${SHARED_LIB} ${HIREDIS_TLS_LIB}) -+ target_link_libraries(${SHARED_LIB} PUBLIC hiredis::hiredis_ssl) - endif() - - set_target_properties(${SHARED_LIB} PROPERTIES OUTPUT_NAME ${PROJECT_NAME}) diff --git a/recipes/redis-plus-plus/all/patches/1.2.1-0002-cmake-minimum-required.patch b/recipes/redis-plus-plus/all/patches/1.2.1-0002-cmake-minimum-required.patch deleted file mode 100644 index d00f3b331f4ab..0000000000000 --- a/recipes/redis-plus-plus/all/patches/1.2.1-0002-cmake-minimum-required.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,10 +1,10 @@ --project(redis++) - - if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - cmake_minimum_required(VERSION 3.0.0) - else() -- cmake_minimum_required(VERSION 2.8.0) -+ cmake_minimum_required(VERSION 3.0.0) - endif() -+project(redis++) - - if (NOT DEFINED REDIS_PLUS_PLUS_CXX_STANDARD) - set(REDIS_PLUS_PLUS_CXX_STANDARD 11)