summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorPhilip Chimento <philip.chimento@gmail.com>2019-05-31 23:40:53 -0700
committerPhilip Chimento <philip.chimento@gmail.com>2019-06-08 23:11:29 -0700
commit01920362be26a2cb4e38b55cc211351391885d1d (patch)
treee82cc9c7af565610eb756ea5a561dbd83359d9a0 /Makefile.am
parente9d108c4a67a45bc2caf5429736f164956f6c9dc (diff)
downloadgjs-01920362be26a2cb4e38b55cc211351391885d1d.tar.gz
maint: Fix header includes once and for all
Previously #include statements were a bit of a mess across the codebase. This commit is the result of a pass by the IWYU (Include What You Use) tool, which suggests headers to add or remove based on what is in the file, and can also suggest forward-declaring classes instead of including their headers, if they are only used as a pointer in a particular file. Cleaning this up should in general speed up compile times. IWYU isn't perfect, it produces a number of false positives, so we don't try to automate this process and we don't accept all of its recommendations. We do add a script and configuration file to the tools/ directory so that IWYU can be every so often in the future. We also clean up all the includes according to a consistent style, which is now described clearly in the C++ style guide.
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am4
1 files changed, 4 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
index 0949f63f..1b3b6d9d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -257,4 +257,8 @@ cppcheck:
--enable=warning,performance,portability,information,missingInclude \
--force -q $(top_srcdir) -I $(top_builddir)
+# Include What You Use: run 'make iwyu | tee iwyu.log'
+iwyu: tools/run_iwyu.sh
+ SRCDIR=$(abs_top_srcdir) BUILDDIR=$(abs_top_builddir) tools/run_iwyu.sh 2>&1
+
-include $(top_srcdir)/git.mk