Skip to content

Commit

Permalink
Improve Clangd support
Browse files Browse the repository at this point in the history
  • Loading branch information
jchv committed Aug 1, 2024
1 parent a5476c6 commit d17f3ee
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,15 @@
buildPhase = ''
runHook preBuild
bear -- make -j
make -j
(printf -- "-nostdlib\n-nostdinc\n-nostdinc++\n--target=i686-pc-windows-gnu\n-D_WIN32\n-D__MINGW32__\n-DSTRSAFE_NO_DEPRECATE" \
&& </dev/null i686-w64-mingw32-gcc -E -v - 2>&1 \
| grep ^COLLECT_GCC_OPTIONS= \
| tail -1 \
| cut -d= -f2- \
| xargs -n1 printf "%s\n" \
) > compile_flags.txt
runHook postBuild
'';
Expand All @@ -56,20 +64,20 @@
runHook preInstall
install -D -t $out/lib out/ijl15.dll
install -D --mode=0644 -t $out compile_commands.json
install -D --mode=0644 -t $out compile_flags.txt
runHook postInstall
'';
};

# Dev shell
devShell = pkgs.mkShell {
nativeBuildInputs = nativeBuildInputs ++ nativeCheckInputs ++ [ pkgs.clang-tools ];
nativeBuildInputs = nativeBuildInputs ++ nativeCheckInputs ++ [ pkgs.clang.cc ];
};

# Clangd setup
setupClangd = pkgs.writeShellScriptBin "setup-clangd.sh" ''
install -D --mode=0644 -t . ${rugburn}/compile_commands.json
install -D --mode=0644 -t . ${rugburn}/compile_flags.txt
'';

# Website setup
Expand Down

0 comments on commit d17f3ee

Please sign in to comment.