cc-wrapper: replace "-isystem" by "-cxx-isystem" for c++ header

This commit is contained in:
wrvsrx 2022-04-19 20:22:36 +08:00
parent d2bbcbe6c6
commit d0e80df0dc
No known key found for this signature in database
GPG Key ID: 8BCC6FC7D2BDCB3B

View File

@ -366,14 +366,14 @@ stdenv.mkDerivation {
''
+ optionalString (libcxx == null && (useGccForLibs && gccForLibs.langCC or false)) ''
for dir in ${gccForLibs}${lib.optionalString (hostPlatform != targetPlatform) "/${targetPlatform.config}"}/include/c++/*; do
echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags
echo "-cxx-isystem $dir" >> $out/nix-support/libc-cflags
done
for dir in ${gccForLibs}${lib.optionalString (hostPlatform != targetPlatform) "/${targetPlatform.config}"}/include/c++/*/${targetPlatform.config}; do
echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags
echo "-cxx-isystem $dir" >> $out/nix-support/libc-cflags
done
''
+ optionalString (libcxx.isLLVM or false) ''
echo "-isystem ${lib.getDev libcxx}/include/c++/v1" >> $out/nix-support/libcxx-cxxflags
echo "-cxx-isystem ${lib.getDev libcxx}/include/c++/v1" >> $out/nix-support/libc-cflags
echo "-stdlib=libc++" >> $out/nix-support/libcxx-ldflags
echo "-l${libcxx.cxxabi.libName}" >> $out/nix-support/libcxx-ldflags
''