Merge pull request #124272 from gebner/ccls-headers-2105
[21.05] ccls: fix libc++ header path
This commit is contained in:
commit
b7f77e07b2
@ -21,17 +21,11 @@ stdenv.mkDerivation rec {
|
|||||||
cmakeFlagsArray+=(-DCMAKE_CXX_FLAGS="-fvisibility=hidden -fno-rtti")
|
cmakeFlagsArray+=(-DCMAKE_CXX_FLAGS="-fvisibility=hidden -fno-rtti")
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
clang = llvmPackages.clang;
|
||||||
shell = runtimeShell;
|
shell = runtimeShell;
|
||||||
|
|
||||||
postFixup = ''
|
postFixup = ''
|
||||||
# We need to tell ccls where to find the standard library headers.
|
export wrapped=".ccls-wrapped"
|
||||||
|
|
||||||
standard_library_includes="\\\"-isystem\\\", \\\"${lib.getDev stdenv.cc.libc}/include\\\""
|
|
||||||
standard_library_includes+=", \\\"-isystem\\\", \\\"${llvmPackages.libcxx}/include/c++/v1\\\""
|
|
||||||
export standard_library_includes
|
|
||||||
|
|
||||||
wrapped=".ccls-wrapped"
|
|
||||||
export wrapped
|
|
||||||
|
|
||||||
mv $out/bin/ccls $out/bin/$wrapped
|
mv $out/bin/ccls $out/bin/$wrapped
|
||||||
substituteAll ${./wrapper} $out/bin/ccls
|
substituteAll ${./wrapper} $out/bin/ccls
|
||||||
chmod --reference=$out/bin/$wrapped $out/bin/ccls
|
chmod --reference=$out/bin/$wrapped $out/bin/ccls
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
#! @shell@ -e
|
#! @shell@ -e
|
||||||
|
|
||||||
initString="--init={\"clang\":{\"extraArgs\": [@standard_library_includes@"
|
printf -v extraArgs ',\"%s\"' \
|
||||||
|
$(cat @clang@/nix-support/libc-cflags \
|
||||||
if [ "${NIX_CFLAGS_COMPILE}" != "" ]; then
|
@clang@/nix-support/libcxx-cxxflags) \
|
||||||
read -a cflags_array <<< ${NIX_CFLAGS_COMPILE}
|
${NIX_CFLAGS_COMPILE}
|
||||||
initString+=$(printf ', \"%s\"' "${cflags_array[@]}")
|
initString="--init={\"clang\":{\"extraArgs\":[${extraArgs:1}]}}"
|
||||||
fi
|
|
||||||
|
|
||||||
initString+="]}}"
|
|
||||||
|
|
||||||
exec -a "$0" "@out@/bin/@wrapped@" "${initString}" "$@"
|
exec -a "$0" "@out@/bin/@wrapped@" "${initString}" "$@"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user