60 lines
1.8 KiB
Plaintext
60 lines
1.8 KiB
Plaintext
# 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/>.
|
|
|
|
from conan import ConanFile
|
|
from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps
|
|
from conan.tools.files import get
|
|
from conan.tools.env import VirtualBuildEnv
|
|
|
|
import os
|
|
|
|
|
|
class Cmake(ConanFile):
|
|
name = "cmake"
|
|
version = "3.26.0"
|
|
settings = "os", "arch", "build_type", "compiler"
|
|
|
|
def requirements(self):
|
|
if self.settings.compiler == "gcc":
|
|
self.requires(f"gcc/latest@{self.user}/{self.channel}")
|
|
self.tool_requires(f"gcc/latest@{self.user}/{self.channel}")
|
|
|
|
def source(self):
|
|
get(
|
|
self,
|
|
f"https://github.com/Kitware/CMake/archive/v{self.version}.tar.gz",
|
|
)
|
|
|
|
def generate(self):
|
|
tc = CMakeToolchain(self)
|
|
tc.generate()
|
|
deps = CMakeDeps(self)
|
|
deps.generate()
|
|
|
|
def build(self):
|
|
cmake = CMake(self)
|
|
cmake.configure(
|
|
{"CMAKE_USE_OPENSSL": "OFF", "BUILD_TESTING": "OFF"},
|
|
build_script_folder=f"CMake-{self.version}",
|
|
)
|
|
cmake.build()
|
|
cmake.install()
|
|
|
|
def package_info(self):
|
|
self.buildenv_info.prepend_path(
|
|
"PATH", os.path.join(self.package_folder, "bin")
|
|
)
|