cc-wrapper: revert change to -isystem

This commit is contained in:
wrvsrx 2023-01-31 11:40:23 +08:00
parent ee2b2cef35
commit b59d61aa48
No known key found for this signature in database
GPG Key ID: 8BCC6FC7D2BDCB3B
2 changed files with 4 additions and 26 deletions

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 "-cxx-isystem $dir" >> $out/nix-support/libcxx-cxxflags
echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags
done
for dir in ${gccForLibs}${lib.optionalString (hostPlatform != targetPlatform) "/${targetPlatform.config}"}/include/c++/*/${targetPlatform.config}; do
echo "-cxx-isystem $dir" >> $out/nix-support/libcxx-cxxflags
echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags
done
''
+ optionalString (libcxx.isLLVM or false) ''
echo "-cxx-isystem ${lib.getDev libcxx}/include/c++/v1" >> $out/nix-support/libcxx-cxxflags
echo "-isystem ${lib.getDev libcxx}/include/c++/v1" >> $out/nix-support/libcxx-cxxflags
echo "-stdlib=libc++" >> $out/nix-support/libcxx-ldflags
echo "-l${libcxx.cxxabi.libName}" >> $out/nix-support/libcxx-ldflags
''

View File

@ -18,31 +18,9 @@ buildcpath() {
echo $path${after:+':'}$after
}
buildcxxpath() {
local path after
while (( $# )); do
case $1 in
-isystem)
shift
path=$path${path:+':'}$1
;;
-cxx-isystem)
shift
path=$path${path:+':'}$1
;;
-idirafter)
shift
after=$after${after:+':'}$1
;;
esac
shift
done
echo $path${after:+':'}$after
}
export CPATH=${CPATH}${CPATH:+':'}$(buildcpath ${NIX_CFLAGS_COMPILE} \
$(<@clang@/nix-support/libc-cflags)):@clang@/resource-root/include
export CPLUS_INCLUDE_PATH=${CPLUS_INCLUDE_PATH}${CPLUS_INCLUDE_PATH:+':'}$(buildcxxpath ${NIX_CFLAGS_COMPILE} \
export CPLUS_INCLUDE_PATH=${CPLUS_INCLUDE_PATH}${CPLUS_INCLUDE_PATH:+':'}$(buildcpath ${NIX_CFLAGS_COMPILE} \
$(<@clang@/nix-support/libcxx-cxxflags) \
$(<@clang@/nix-support/libc-cflags)):@clang@/resource-root/include