Skip to content

Commit

Permalink
Provide basic configuration for IWYU
Browse files Browse the repository at this point in the history
  • Loading branch information
BenBE committed Oct 18, 2020
1 parent 8c93f31 commit 29346d0
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
10 changes: 10 additions & 0 deletions iwyu/htop.imp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{ 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"] },
]
12 changes: 12 additions & 0 deletions iwyu/run_iwyu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

SCRIPT=$(readlink -f "$0")
SCRIPTDIR=$(dirname "$SCRIPT")
SOURCEDIR="$SCRIPTDIR/.."

PKG_NL3=$(pkg-config --cflags libnl-3.0)

cd "$SOURCEDIR"

make clean
make -k CC="iwyu" CFLAGS="-Xiwyu --no_comments -Xiwyu --no_fwd_decl -Xiwyu --mapping_file='$SCRIPTDIR/htop.imp' $PKG_NL3"

0 comments on commit 29346d0

Please sign in to comment.