summaryrefslogtreecommitdiff
path: root/gnu/packages/llvm.scm
diff options
context:
space:
mode:
authorHilton Chain <hako@ultrarare.space>2023-10-23 20:43:55 +0800
committerEfraim Flashner <efraim@flashner.co.il>2023-11-12 08:49:46 +0200
commit8d5b31394b019965a9beef29ab8db18ab2f95f72 (patch)
treed00e017d2618a765f5c822adf827478e0c1794ec /gnu/packages/llvm.scm
parentb7b945c32fd4e54d9fefe1ff9f4c341db804c289 (diff)
gnu: Add clang-17.
* gnu/packages/llvm.scm (clang-from-llvm)[arguments]: Include test runner in CMakeLists.txt when version >= 17. (clang-17): New variable. Change-Id: Ia3cd8013d497b72522e95f6face5975bf79f93b3
Diffstat (limited to 'gnu/packages/llvm.scm')
-rw-r--r--gnu/packages/llvm.scm21
1 files changed, 21 insertions, 0 deletions
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index bba9830b38..3fbabae040 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -358,6 +358,15 @@ until LLVM/Clang 14."
(("@GLIBC_LIBDIR@")
(string-append libc "/lib"))))))
#t)))
+ ,@(if (version>=? version "17")
+ '((add-after 'unpack 'include-test-runner
+ (lambda _
+ (substitute* "CMakeLists.txt"
+ ((".*llvm_gtest" line)
+ (string-append
+ "add_subdirectory(${LLVM_THIRD_PARTY_DIR}/uni\
+ttest third-party/unittest)\n" line))))))
+ '())
;; Awkwardly, multiple phases added after the same phase,
;; e.g. unpack, get applied in the reverse order. In other
;; words, adding 'change-directory last means it occurs
@@ -1497,6 +1506,18 @@ Library.")
(define-public clang-runtime-17
(clang-runtime-from-llvm llvm-17))
+(define-public clang-17
+ (clang-from-llvm
+ llvm-17 clang-runtime-17
+ #:tools-extra
+ (origin
+ (method url-fetch)
+ (uri (llvm-uri "clang-tools-extra"
+ (package-version llvm-17)))
+ (sha256
+ (base32
+ "0an16xdc8rgrdf0dcq3sdg82ajyb00h4bff9n0gm7gqf48ds0da8")))))
+
;; Default LLVM and Clang version.
(define-public libomp libomp-13)
(define-public llvm llvm-13)