clang-tools: add optional support for libcxx

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
Amneesh Singh 2023-09-24 15:00:41 +05:30 committed by Jörg Thalheim
parent 4242ecd871
commit 310c3a1e26

View file

@ -1,4 +1,6 @@
{ lib, stdenv, llvmPackages }:
{ lib, stdenv, llvmPackages, enableLibcxx ? false }:
# enableLibcxx will use the c++ headers from clang instead of gcc.
# This shouldn't have any effect on platforms that use clang as the default compiler already.
let
unwrapped = llvmPackages.clang-unwrapped;
@ -9,7 +11,7 @@ in stdenv.mkDerivation {
pname = "clang-tools";
version = lib.getVersion unwrapped;
dontUnpack = true;
clang = llvmPackages.clang;
clang = if enableLibcxx then llvmPackages.libcxxClang else llvmPackages.clang;
installPhase = ''
runHook preInstall