mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-26 23:54:01 +00:00
8e06a39574
Whatever change has necessitated https://github.com/NixOS/nixpkgs/pull/122044, it also broke clangd -- <clang-wrapper>/resource-root/include is no longer automagically searched for includes, which kills pretty much any indexing since that directory contains vital stuff like stddef.h etc. Fix by appending the directory to CPATH & CPLUS_INCLUDE_PATH in the clangd wrapper.
28 lines
949 B
Bash
Executable File
28 lines
949 B
Bash
Executable File
#!/bin/sh
|
|
|
|
buildcpath() {
|
|
local path after
|
|
while (( $# )); do
|
|
case $1 in
|
|
-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:+':'}$(buildcpath ${NIX_CFLAGS_COMPILE} \
|
|
$(<@clang@/nix-support/libcxx-cxxflags) \
|
|
$(<@clang@/nix-support/libc-cflags)):@clang@/resource-root/include
|
|
|
|
exec -a "$0" @unwrapped@/bin/$(basename $0) "$@"
|