48 lines
1.4 KiB
Python
48 lines
1.4 KiB
Python
version = "22.1.6"
|
|
revision = 1
|
|
description = "LLVM compiler infrastructure with clang and lld"
|
|
license = "Apache-2.0 WITH LLVM-exception"
|
|
url = "https://llvm.org/"
|
|
source = tarball(
|
|
url=f"https://github.com/llvm/llvm-project/releases/download/llvmorg-{version}/llvm-project-{version}.src.tar.xz",
|
|
sha256="4579051e3c255fb4bb795d54324f5a7f3ef79bd9181e44293d7ee9a7f62aad9a",
|
|
)
|
|
host_deps = ["binutils"]
|
|
|
|
|
|
def configure(self):
|
|
self.run(
|
|
"cmake",
|
|
"-S",
|
|
self.source_dir / "llvm",
|
|
"-B",
|
|
self.build_dir,
|
|
"-GNinja",
|
|
f"-DDEFAULT_SYSROOT={self.sysroot}",
|
|
f"-DCMAKE_INSTALL_PREFIX={self.prefix}",
|
|
"-UBUILD_SHARED_LIBS",
|
|
"-UENABLE_STATIC",
|
|
"-DCMAKE_BUILD_TYPE=Release",
|
|
"-DLLVM_LINK_LLVM_DYLIB=ON",
|
|
"-DLLVM_ENABLE_FFI=ON",
|
|
"-DLLVM_ENABLE_EH=ON",
|
|
"-DLLVM_ENABLE_RTTI=ON",
|
|
"-DLLVM_ENABLE_PROJECTS=clang;lld;clang-tools-extra",
|
|
f"-DLLVM_DEFAULT_TARGET_TRIPLE={self.triple}",
|
|
f"-DLLVM_HOST_TRIPLE={self.triple}",
|
|
"-Wno-dev",
|
|
env={
|
|
"CFLAGS": self.profile["host_cflags"],
|
|
"CXXFLAGS": self.profile["host_cxxflags"],
|
|
"LDFLAGS": self.profile["host_ldflags"],
|
|
},
|
|
)
|
|
|
|
|
|
def build(self):
|
|
self.run("cmake", "--build", self.build_dir, f"-j{self.jobs}")
|
|
|
|
|
|
def install(self):
|
|
self.run("cmake", "--install", self.build_dir, env={"DESTDIR": str(self.dest_dir)})
|