From 4b6d34214d02227db7bba31c996f09e90d507e83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 15 Dec 2023 21:50:33 +0100 Subject: [PATCH] add include-what-you-use to devshell --- shell.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/shell.nix b/shell.nix index a94d881..13a5d34 100644 --- a/shell.nix +++ b/shell.nix @@ -26,8 +26,14 @@ pkgs.mkShell { (pkgs.python3.withPackages (ps: [ ps.pytest ])) - - ]; + ] ++ lib.optional stdenv.isLinux # broken on darwin + (pkgs.writeShellScriptBin "update-include-what-you-use" '' + #!${pkgs.stdenv.shell} + export PATH=${pkgs.include-what-you-use}/bin:$PATH + find src -type f -name '*.cpp' -o -name '*.hh' -print0 | \ + xargs -n1 --null include-what-you-use -std=c++20 -isystem ${lib.getDev nix}/include/nix 2>&1 | \ + fix_includes.py + ''); shellHook = lib.optionalString stdenv.isLinux '' export NIX_DEBUG_INFO_DIRS="${pkgs.curl.debug}/lib/debug:${nix.debug}/lib/debug''${NIX_DEBUG_INFO_DIRS:+:$NIX_DEBUG_INFO_DIRS}"