clang-tools: use $C_INCLUDE_PATH for C includes
$CPATH is taken to mean the same thing as -I by clang, whereas $C_INCLUDE_PATH is -isystem. Using $CPATH means tools like clangd will generate warnings for problems in system headers, which is undesirable. See llvm/llvm-project#154015
This commit is contained in:
@@ -47,8 +47,8 @@ for arg in "$@"; do
|
||||
done
|
||||
|
||||
if [ "$extendcpath" = true ]; then
|
||||
export CPATH=${CPATH}${CPATH:+':'}$(buildcpath ${NIX_CFLAGS_COMPILE} \
|
||||
$(<@clang@/nix-support/libc-cflags))
|
||||
export C_INCLUDE_PATH=${CPATH}${CPATH:+':'}$(buildcpath ${NIX_CFLAGS_COMPILE} \
|
||||
$(<@clang@/nix-support/libc-cflags))
|
||||
|
||||
export CPLUS_INCLUDE_PATH=${CPLUS_INCLUDE_PATH}${CPLUS_INCLUDE_PATH:+':'}$(buildcpluspath ${NIX_CFLAGS_COMPILE} \
|
||||
$(<@clang@/nix-support/libcxx-cxxflags) \
|
||||
|
||||
Reference in New Issue
Block a user