summaryrefslogtreecommitdiff
path: root/gnu/packages/llvm.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2020-03-15 16:08:06 +0100
committerMarius Bakke <mbakke@fastmail.com>2020-03-15 16:08:06 +0100
commit40a461fd97fb865987e4f6cc41fee6ee6408851d (patch)
tree9ec518693b5b54894acf7e7df95c1a524fc44d43 /gnu/packages/llvm.scm
parentf42bfc7a99b1e152cd014fca069083527f10665c (diff)
gnu: libcxx: Hide GCC's C++ headers during the build process.
* gnu/packages/llvm.scm (libcxx)[arguments]: New field.
Diffstat (limited to 'gnu/packages/llvm.scm')
-rw-r--r--gnu/packages/llvm.scm17
1 files changed, 17 insertions, 0 deletions
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 3909039f3e..ef273e3ef6 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -671,6 +671,23 @@ output), and Binutils.")
(base32
"0d2bj5i6mk4caq7skd5nsdmz8c2m5w5anximl5wz3x32p08zz089"))))
(build-system cmake-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases (@ (guix build cmake-build-system) %standard-phases)
+ (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((gcc (assoc-ref inputs "gcc")))
+ ;; Hide GCC's C++ headers so that they do not interfere with
+ ;; the ones we are attempting to build.
+ (setenv "CPLUS_INCLUDE_PATH"
+ (string-join (delete (string-append gcc "/include/c++")
+ (string-split (getenv "CPLUS_INCLUDE_PATH")
+ #\:))
+ ":"))
+ (format #t
+ "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
+ (getenv "CPLUS_INCLUDE_PATH"))
+ #t))))))
(native-inputs
`(("clang" ,clang)
("llvm" ,llvm)))