summaryrefslogtreecommitdiffstats
path: root/toolchain.inc
diff options
context:
space:
mode:
Diffstat (limited to 'toolchain.inc')
-rw-r--r--toolchain.inc15
1 files changed, 15 insertions, 0 deletions
diff --git a/toolchain.inc b/toolchain.inc
index 893f7d1a11a8..47c5fe9b8511 100644
--- a/toolchain.inc
+++ b/toolchain.inc
@@ -32,6 +32,21 @@ HOSTCC:=CCC_CC="$(HOSTCC)" $(CC)
HOSTCXX:=CCC_CXX="$(HOSTCXX)" $(CXX)
endif
+# include-what-you-use integration
+ifeq ($(CONFIG_IWYU),y)
+
+IWYU:=$(word 1,$(wildcard $(addsuffix /iwyu,$(subst :, ,$(PATH)))))
+ifeq ($(IWYU),)
+$(error include-what-you-use selected, but not found in PATH)
+endif
+
+$(foreach arch,$(ARCH_SUPPORTED), \
+ $(eval CC_$(arch):=$(IWYU) ))
+
+CFLAGS_common := -Xiwyu --prefix_header_includes=remove -Xiwyu --no_comments -Xiwyu --no_fwd_decls $(CFLAGS_common)
+NOCOMPILE := 1
+endif
+
COREBOOT_STANDARD_STAGES := decompressor bootblock verstage romstage ramstage
MAP-decompressor := bootblock