generated from Sithas/conan_template
Кое-какая настройка Conan'a
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
sources:
|
||||
"1.3.1":
|
||||
url: "https://github.com/madler/zlib/archive/refs/tags/v1.3.1.tar.gz"
|
||||
sha256: "17e88863f3600672ab49182f217281b6fc4d3c762bde361935e436a95214d05c"
|
||||
@@ -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"]
|
||||
Reference in New Issue
Block a user