[gjs: 7/18] build: Improve IWYU script
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs: 7/18] build: Improve IWYU script
- Date: Tue, 31 Dec 2019 23:15:35 +0000 (UTC)
commit 822741991f93a2b8597b2f287f9e71af876a75a5
Author: Philip Chimento <philip chimento gmail com>
Date: Sat Nov 23 23:16:23 2019 -0800
build: Improve IWYU script
Allow build directories other than _build with the BUILDDIR environment
variable; add a few files that were missed; adapt to newer IWYU versions
that require -Xiwyu for their arguments; and automatically keep config.h
without having to comment a special IWYU pragma.
tools/run_iwyu.sh | 55 ++++++++++++++++++++++++++++++-------------------------
1 file changed, 30 insertions(+), 25 deletions(-)
---
diff --git a/tools/run_iwyu.sh b/tools/run_iwyu.sh
index 7a6260ce..57b7bc5e 100755
--- a/tools/run_iwyu.sh
+++ b/tools/run_iwyu.sh
@@ -1,37 +1,42 @@
#!/bin/sh
-ninja -C _build
-cd _build
+SRCDIR=$(pwd)
+
+cd ${BUILDDIR:-_build}
+ninja
IWYU="iwyu_tool -p ."
-PRIVATE_MAPPING="--mapping_file=../tools/gjs-private-iwyu.imp"
-PUBLIC_MAPPING="--mapping_file=../tools/gjs-public-iwyu.imp"
+PRIVATE_MAPPING="-Xiwyu --mapping_file=$SRCDIR/tools/gjs-private-iwyu.imp -Xiwyu --keep=config.h"
+PUBLIC_MAPPING="-Xiwyu --mapping_file=$SRCDIR/tools/gjs-public-iwyu.imp"
-for FILE in ../gi/*.cpp ../gi/gjs_gi_trace.h ../gjs/atoms.cpp \
- ../gjs/byteArray.cpp ../gjs/coverage.cpp ../gjs/debugger.cpp \
- ../gjs/deprecation.cpp ../gjs/error-types.cpp ../gjs/engine.cpp \
- ../gjs/global.cpp ../gjs/importer.cpp ../gjs/jsapi-util-args.h \
- ../gjs/jsapi-util-error.cpp ../gjs/jsapi-util-root.h \
- ../gjs/jsapi-util-string.cpp ../js/jsapi-util.cpp ../gjs/module.cpp \
- ../gjs/native.cpp ../gjs/stack.cpp ../modules/cairo-*.cpp \
- ../modules/console.cpp ../modules/system.cpp ../test/*.cpp ../util/*.cpp \
- ../libgjs-private/*.c
+for FILE in $SRCDIR/gi/*.cpp $SRCDIR/gjs/atoms.cpp $SRCDIR/gjs/byteArray.cpp \
+ $SRCDIR/gjs/coverage.cpp $SRCDIR/gjs/debugger.cpp \
+ $SRCDIR/gjs/deprecation.cpp $SRCDIR/gjs/error-types.cpp \
+ $SRCDIR/gjs/engine.cpp $SRCDIR/gjs/global.cpp $SRCDIR/gjs/importer.cpp \
+ $SRCDIR/gjs/jsapi-util-error.cpp $SRCDIR/gjs/jsapi-util-string.cpp \
+ $SRCDIR/gjs/module.cpp $SRCDIR/gjs/native.cpp $SRCDIR/gjs/stack.cpp \
+ $SRCDIR/modules/cairo-*.cpp $SRCDIR/modules/console.cpp \
+ $SRCDIR/modules/system.cpp $SRCDIR/test/*.cpp $SRCDIR/util/*.cpp \
+ $SRCDIR/libgjs-private/*.c
do
$IWYU $FILE -- $PRIVATE_MAPPING
done
-$IWYU ../gjs/context.cpp -- $PRIVATE_MAPPING \
- --check_also=../gjs/context-private.h
-$IWYU ../gjs/jsapi-dynamic-class.cpp -- $PRIVATE_MAPPING \
- --check_also=../gjs/jsapi-class.h
-$IWYU ../gjs/mem.cpp -- $PRIVATE_MAPPING --check_also=../gjs/mem-private.h
-$IWYU ../gjs/profiler.cpp -- $PRIVATE_MAPPING \
- --check_also=../gjs/profiler-private.h
-$IWYU ../modules/cairo.cpp -- $PRIVATE_MAPPING \
- --check_also=../modules/cairo-module.h \
- --check_also=../modules/cairo-private.h
+$IWYU $SRCDIR/gjs/context.cpp -- $PRIVATE_MAPPING \
+ -Xiwyu --check_also=$SRCDIR/gjs/context-private.h
+$IWYU $SRCDIR/gjs/jsapi-dynamic-class.cpp -- $PRIVATE_MAPPING \
+ -Xiwyu --check_also=$SRCDIR/gjs/jsapi-class.h
+$IWYU $SRCDIR/gjs/jsapi-util.cpp -- $PRIVATE_MAPPING \
+ -Xiwyu --check_also=$SRCDIR/gjs/jsapi-util-args.h \
+ -Xiwyu --check_also=$SRCDIR/gjs/jsapi-util-root.h
+$IWYU $SRCDIR/gjs/mem.cpp -- $PRIVATE_MAPPING \
+ -Xiwyu --check_also=$SRCDIR/gjs/mem-private.h
+$IWYU $SRCDIR/gjs/profiler.cpp -- $PRIVATE_MAPPING \
+ -Xiwyu --check_also=$SRCDIR/gjs/profiler-private.h
+$IWYU $SRCDIR/modules/cairo.cpp -- $PRIVATE_MAPPING \
+ -Xiwyu --check_also=$SRCDIR/modules/cairo-module.h \
+ -Xiwyu --check_also=$SRCDIR/modules/cairo-private.h
-for FILE in ../gjs/macros.h ../gjs/console.cpp \
- ../installed-tests/minijasmine.cpp
+for FILE in $SRCDIR/gjs/console.cpp $SRCDIR/installed-tests/minijasmine.cpp
do
$IWYU $FILE -- $PUBLIC_MAPPING
done
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]