From 4dcf795433c29758bf30dc4c37a8112881d0b536 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Wed, 5 Feb 2025 17:59:52 -0700 Subject: [PATCH] tc_build: llvm: Use runtimes build for LLVM 20 and newer The deprecation warning was merged a little before the LLVM 20 branch, so use the runtimes build for LLVM 20 and newer. Signed-off-by: Nathan Chancellor --- tc_build/llvm.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tc_build/llvm.py b/tc_build/llvm.py index f822b201..6bf0e019 100644 --- a/tc_build/llvm.py +++ b/tc_build/llvm.py @@ -12,6 +12,8 @@ from tc_build.builder import Builder import tc_build.utils +LLVM_VER_FOR_RUNTIMES = 20 + def get_all_targets(llvm_folder): contents = Path(llvm_folder, 'llvm/CMakeLists.txt').read_text(encoding='utf-8') @@ -251,7 +253,8 @@ def configure(self): # https://github.com/llvm/llvm-project/commit/b593110d89aea76b8b10152b24ece154bff3e4b5 llvm_enable_projects = self.projects.copy() - if self.llvm_major_version >= 21 and self.project_is_enabled('compiler-rt'): + if self.llvm_major_version >= LLVM_VER_FOR_RUNTIMES and self.project_is_enabled( + 'compiler-rt'): llvm_enable_projects.remove('compiler-rt') self.cmake_defines['LLVM_ENABLE_RUNTIMES'] = 'compiler-rt' self.cmake_defines['LLVM_ENABLE_PROJECTS'] = ';'.join(llvm_enable_projects) @@ -433,7 +436,7 @@ def configure(self): distribution_components.append('lld') if build_compiler_rt: distribution_components.append('llvm-profdata') - if self.llvm_major_version >= 21: + if self.llvm_major_version >= LLVM_VER_FOR_RUNTIMES: distribution_components.append('runtimes') runtime_distribution_components.append('profile') else: