[gjs: 7/10] CI: Handle precompiled headers in iwyu command line




commit da30e55dfd514dbe14ece3bcf3eaec794ca8d892
Author: Philip Chimento <philip chimento gmail com>
Date:   Sat Jul 23 09:42:49 2022 -0700

    CI: Handle precompiled headers in iwyu command line
    
    I'm not sure if this has always been broken since we added precompiled
    headers, or if it's been broken recently by an iwyu upgrade. But
    apparently we need to add this extra argument, otherwise we get 'fatal
    error: gjs_pch.hh file not found'.

 tools/run_iwyu.sh | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/tools/run_iwyu.sh b/tools/run_iwyu.sh
index 8b3fdbb34..e67ff5969 100755
--- a/tools/run_iwyu.sh
+++ b/tools/run_iwyu.sh
@@ -44,6 +44,7 @@ fi
 echo "files: $files"
 
 IWYU="python3 $(which iwyu_tool || which iwyu-tool || which iwyu_tool.py) -p ."
+IWYU_TOOL_ARGS="-I../gjs"
 IWYU_ARGS="-Wno-pragma-once-outside-header"
 IWYU_RAW="include-what-you-use -xc++ -std=c++17 -Xiwyu --keep=config.h $IWYU_ARGS"
 IWYU_RAW_INC="-I. -I.. $(pkg-config --cflags gobject-introspection-1.0 mozjs-91)"
@@ -79,7 +80,7 @@ for FILE in $SRCDIR/gi/*.cpp $SRCDIR/gjs/atoms.cpp $SRCDIR/gjs/byteArray.cpp \
     $SRCDIR/util/*.cpp $SRCDIR/libgjs-private/*.c
 do
     if should_analyze $FILE; then
-        if ! $IWYU $FILE -- $PRIVATE_MAPPING | $POSTPROCESS; then
+        if ! $IWYU $FILE -- $PRIVATE_MAPPING $IWYU_TOOL_ARGS | $POSTPROCESS; then
             EXIT=1
         fi
     fi
@@ -89,6 +90,7 @@ done
 if ( should_analyze $SRCDIR/gjs/jsapi-dynamic-class.cpp || \
     should_analyze $SRCDIR/gjs/jsapi-class.h ); then
     if ! $IWYU $SRCDIR/gjs/jsapi-dynamic-class.cpp -- $PRIVATE_MAPPING \
+        $IWYU_TOOL_ARGS \
         -Xiwyu --check_also=*/gjs/jsapi-class.h | $POSTPROCESS; then
         EXIT=1
     fi
@@ -97,7 +99,7 @@ fi
 # include header files with private implementation along with their main files
 for STEM in gjs/context gjs/mem gjs/profiler modules/cairo; do
     if should_analyze $SRCDIR/$STEM.cpp; then
-        if ! $IWYU $SRCDIR/$STEM.cpp -- $PRIVATE_MAPPING \
+        if ! $IWYU $SRCDIR/$STEM.cpp -- $PRIVATE_MAPPING $IWYU_TOOL_ARGS \
             -Xiwyu --check_also=*/$STEM-private.h | $POSTPROCESS; then
             EXIT=1
         fi
@@ -107,7 +109,7 @@ done
 for FILE in $SRCDIR/gjs/console.cpp $SRCDIR/installed-tests/minijasmine.cpp
 do
     if should_analyze $FILE; then
-        if ! $IWYU $FILE -- $PUBLIC_MAPPING | $POSTPROCESS; then
+        if ! $IWYU $FILE -- $PUBLIC_MAPPING $IWYU_TOOL_ARGS | $POSTPROCESS; then
             EXIT=1
         fi
     fi


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]