Skip to content

Commit

Permalink
Merge pull request #291 from nathanchance/runtimes-llvm-20
Browse files Browse the repository at this point in the history
tc_build: llvm: Use runtimes build for LLVM 20 and newer
  • Loading branch information
msfjarvis authored Feb 6, 2025
2 parents ddd3804 + 4dcf795 commit 1c89003
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tc_build/llvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 1c89003

Please sign in to comment.