diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2019-01-27 13:55:18 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-27 13:55:18 -0500 |
commit | bb3683d7782756216fe35f3c5dbf888cd84d428c (patch) | |
tree | 5e10cdda904537ac14231e70dcac9be0f2b88dc0 /pkgs/build-support | |
parent | 92f0f8dd68e9456c1dff0f6ffa864ebd0ca87293 (diff) | |
parent | 77550df8e68b5034d6a434c709be69adee1940cc (diff) | |
download | nixlib-bb3683d7782756216fe35f3c5dbf888cd84d428c.tar nixlib-bb3683d7782756216fe35f3c5dbf888cd84d428c.tar.gz nixlib-bb3683d7782756216fe35f3c5dbf888cd84d428c.tar.bz2 nixlib-bb3683d7782756216fe35f3c5dbf888cd84d428c.tar.lz nixlib-bb3683d7782756216fe35f3c5dbf888cd84d428c.tar.xz nixlib-bb3683d7782756216fe35f3c5dbf888cd84d428c.tar.zst nixlib-bb3683d7782756216fe35f3c5dbf888cd84d428c.zip |
Merge pull request #54624 from matthewbauer/libcxx
cc-wrapper: add libcxx for libcxxClang
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/cc-wrapper/default.nix | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index 47c992d1f6ba..75a05d5277bf 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -13,6 +13,7 @@ , extraPackages ? [], extraBuildCommands ? "" , isGNU ? false, isClang ? cc.isClang or false, gnugrep ? null , buildPackages ? {} +, libcxx ? null }: with stdenvNoCC.lib; @@ -44,8 +45,11 @@ let # The wrapper scripts use 'cat' and 'grep', so we may need coreutils. coreutils_bin = if nativeTools then "" else getBin coreutils; - default_cxx_stdlib_compile = optionalString (targetPlatform.isLinux && !(cc.isGNU or false) && !nativeTools && cc ? gcc) - "-isystem $(echo -n ${cc.gcc}/include/c++/*) -isystem $(echo -n ${cc.gcc}/include/c++/*)/$(${cc.gcc}/bin/gcc -dumpmachine)"; + default_cxx_stdlib_compile = if (targetPlatform.isLinux && !(cc.isGNU or false) && !nativeTools && cc ? gcc) then + "-isystem $(echo -n ${cc.gcc}/include/c++/*) -isystem $(echo -n ${cc.gcc}/include/c++/*)/$(${cc.gcc}/bin/gcc -dumpmachine)" + else if targetPlatform.isDarwin && (libcxx != null) && (cc.isClang or false) then + "-isystem ${libcxx}/include/c++/v1" + else ""; # The "infix salt" is a arbitrary string added in the middle of env vars # defined by cc-wrapper's hooks so that multiple cc-wrappers can be used @@ -256,9 +260,9 @@ stdenv.mkDerivation { echo "$ccLDFlags" > $out/nix-support/cc-ldflags echo "$ccCFlags" > $out/nix-support/cc-cflags - '' - - + optionalString propagateDoc '' + '' + optionalString (targetPlatform.isDarwin && (libcxx != null) && (cc.isClang or false)) '' + echo " -L${libcxx}/lib" >> $out/nix-support/cc-ldflags + '' + optionalString propagateDoc '' ## ## Man page and info support ## |