bootstrap-toolchain/packages/zlib/conanfile.py

43 lines
1.4 KiB
Python

# Toolchain builder for the Serene programming language
#
# Copyright (c) 2019-2023 Sameer Rahmani <lxsameer@gnu.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
from conan.tools.cmake import CMakeToolchain, CMakeDeps
from conf.base.zlib import ZlibBase
from conf.utils import get_version, with_musl_toolchain
class Zlib(ZlibBase):
name = "zlib"
def build_requirements(self):
super().build_requirements()
self.tool_requires(
f"clang-bootstrap/{get_version('llvm')}@{self.user}/{self.channel}",
visible=False,
)
self.requires(f"musl/{get_version('musl')}@{self.user}/{self.channel}")
def generate(self):
tc = CMakeToolchain(self)
tc.variables["BUILD_SHARED_LIBS"] = False
with_musl_toolchain(self, tc, "BUILD_TARGET")
tc.generate()
deps = CMakeDeps(self)
deps.generate()