Merge pull request #54624 from matthewbauer/libcxx
cc-wrapper: add libcxx for libcxxClang
This commit is contained in:
commit
bb3683d778
@ -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
|
||||
##
|
||||
|
@ -59,6 +59,7 @@ let
|
||||
|
||||
libcxxClang = wrapCCWith rec {
|
||||
cc = tools.clang-unwrapped;
|
||||
libcxx = targetLlvmLibraries.libcxx;
|
||||
extraPackages = [
|
||||
targetLlvmLibraries.libcxx
|
||||
targetLlvmLibraries.libcxxabi
|
||||
|
@ -59,6 +59,7 @@ let
|
||||
|
||||
libcxxClang = wrapCCWith rec {
|
||||
cc = tools.clang-unwrapped;
|
||||
libcxx = targetLlvmLibraries.libcxx;
|
||||
extraPackages = [
|
||||
targetLlvmLibraries.libcxx
|
||||
targetLlvmLibraries.libcxxabi
|
||||
|
@ -59,6 +59,7 @@ let
|
||||
|
||||
libcxxClang = wrapCCWith rec {
|
||||
cc = tools.clang-unwrapped;
|
||||
libcxx = targetLlvmLibraries.libcxx;
|
||||
extraPackages = [
|
||||
targetLlvmLibraries.libcxx
|
||||
targetLlvmLibraries.libcxxabi
|
||||
|
Loading…
Reference in New Issue
Block a user