summaryrefslogtreecommitdiffstats
path: root/iwyu
diff options
context:
space:
mode:
Diffstat (limited to 'iwyu')
-rw-r--r--iwyu/htop.imp24
-rwxr-xr-xiwyu/run_iwyu.sh14
2 files changed, 38 insertions, 0 deletions
diff --git a/iwyu/htop.imp b/iwyu/htop.imp
new file mode 100644
index 0000000..1416d74
--- /dev/null
+++ b/iwyu/htop.imp
@@ -0,0 +1,24 @@
+[
+ { include: ["<curses.h>", "private", "\"ProvideCurses.h\"", "public"] },
+ { include: ["<ncurses.h>", "private", "\"ProvideCurses.h\"", "public"] },
+ { include: ["<ncurses/curses.h>", "private", "\"ProvideCurses.h\"", "public"] },
+ { include: ["<ncurses/ncurses.h>", "private", "\"ProvideCurses.h\"", "public"] },
+
+ { include: ["<bits/types/struct_tm.h>", "private", "<time.h>", "public"] },
+
+ { include: ["<bits/getopt_core.h>", "private", "<unistd.h>", "public"] },
+
+ { include: ["<sys/dirent.h>", "private", "<dirent.h>", "public"] },
+
+ { include: ["<sys/signal.h>", "private", "<signal.h>", "public"] },
+
+ { include: ["<sys/_stdarg.h>", "private", "<stdarg.h>", "public"] },
+
+ { include: ["<sys/limits.h>", "private", "<limits.h>", "public"] },
+
+ { include: ["<x86/_inttypes.h>", "private", "<inttypes.h>", "public"] },
+
+ { include: ["<linux/capability.h>", "private", "<sys/capability.h>", "public"] },
+
+ { include: ["<bits/mman-shared.h>", "private", "<sys/mman.h>", "public"] },
+]
diff --git a/iwyu/run_iwyu.sh b/iwyu/run_iwyu.sh
new file mode 100755
index 0000000..6139ebe
--- /dev/null
+++ b/iwyu/run_iwyu.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+SCRIPT=$(readlink -f "$0")
+SCRIPTDIR=$(dirname "$SCRIPT")
+SOURCEDIR="$SCRIPTDIR/.."
+
+PKG_NL3=$(pkg-config --cflags libnl-3.0)
+
+IWYU=${IWYU:-iwyu}
+
+cd "$SOURCEDIR" || exit
+
+make clean
+make -k -s CC="$IWYU" CFLAGS="-Xiwyu --no_comments -Xiwyu --no_fwd_decl -Xiwyu --mapping_file='$SCRIPTDIR/htop.imp' $PKG_NL3"