diff --git a/README.md b/README.md index 61914e1..157880f 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ for %I in ("C:\Program Files\Microsoft Visual Studio\2022\Community") do echo %~ conan export custom_recipes/boost/ --user=up_and_down --channel=stable conan export custom_recipes/openssl_fix/ --user=up_and_down --channel=stable conan export custom_recipes/lz4_fix/ --user=up_and_down --channel=stable +conan export custom_recipes/zlib_fix/ --user=up_and_down --channel=stable // Запуск дебага conan install . -pr ./profiles/debug_profile --output-folder=cmake-build-debug --build=missing diff --git a/conanfile.py b/conanfile.py index 91dfd17..56c69a4 100644 --- a/conanfile.py +++ b/conanfile.py @@ -11,10 +11,9 @@ class UpAndDown(ConanFile): self.requires("boost/1.87.0@up_and_down/stable") self.requires("libmysqlclient/8.1.0") self.requires("lz4/1.10.0@up_and_down/stable", override=True) - - # Явно добавляем новую версию zstd с override self.requires("zstd/1.5.7", override=True) self.requires("openssl/3.5.0@up_and_down/stable", force=True) + self.requires("zlib/1.3.1@up_and_down/stable", override=True) def configure(self): # Настройки для boost @@ -22,6 +21,3 @@ class UpAndDown(ConanFile): self.options["boost/*"].without_stacktrace = True self.options["boost/*"].without_context = True self.options["openssl"].shared = True - - def layout(self): - cmake_layout(self) diff --git a/custom_recipes/zlib_fix/conandata.yml b/custom_recipes/zlib_fix/conandata.yml new file mode 100644 index 0000000..0da9731 --- /dev/null +++ b/custom_recipes/zlib_fix/conandata.yml @@ -0,0 +1,4 @@ +sources: + "1.3.1": + url: "https://github.com/madler/zlib/archive/refs/tags/v1.3.1.tar.gz" + sha256: "17e88863f3600672ab49182f217281b6fc4d3c762bde361935e436a95214d05c" \ No newline at end of file diff --git a/custom_recipes/zlib_fix/conanfile.py b/custom_recipes/zlib_fix/conanfile.py new file mode 100644 index 0000000..bff6dad --- /dev/null +++ b/custom_recipes/zlib_fix/conanfile.py @@ -0,0 +1,45 @@ +from conan import ConanFile +from conan.tools.files import get, replace_in_file +import os + +class ZlibConan(ConanFile): + name = "zlib" + version = "1.3.1" + user = "up_and_down" + channel = "stable" + settings = "os", "compiler", "build_type", "arch" + description = "zlib compression library" + license = "Zlib" + url = "https://github.com/madler/zlib" + + # Добавляем экспорт данных + exports = "conandata.yml" + + def source(self): + # Получаем данные из conandata.yml + data = self.conan_data["sources"][self.version] + get(self, **data, strip_root=True) + + # Удаляем блок IPO для Release + cmake_file = os.path.join(self.source_folder, "CMakeLists.txt") + replace_in_file( + self, + cmake_file, + "# interprocedural optimizations\n" + "if(CMAKE_INTERPROCEDURAL_OPTIMIZATION)\n" + " set_target_properties(zlib PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${CMAKE_INTERPROCEDURAL_OPTIMIZATION})\n" + "endif()", + "", + strict=False + ) + + def build(self): + # Ваша логика сборки + pass + + def package(self): + # Ваша логика упаковки + pass + + def package_info(self): + self.cpp_info.libs = ["z"] \ No newline at end of file