Module: check_mk
Branch: master
Commit: e0bb15ed3659784d008b1fbf423c817d48d39276
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e0bb15ed365978…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Tue Dec 12 09:39:21 2017 +0100
Use local compilation database for IWYU.
Change-Id: Id53535a6217d3c8e2f51ebce25e60fa683142d55
---
Makefile | 8 +++++---
livestatus/src/Makefile.am | 4 ++++
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index a653da8..629e71e 100644
--- a/Makefile
+++ b/Makefile
@@ -490,9 +490,11 @@ ifeq ($(ENTERPRISE),yes)
$(MAKE) -C enterprise/core/src tidy
endif
-# Not really perfect rules, but better than nothing
-iwyu: compile_commands.json
- @$(IWYU_TOOL) --output-format=clang -p . -- --mapping_file=$(realpath
tests/iwyu-mappings/check_mk.imp)
+iwyu: config.h
+ $(MAKE) -C livestatus/src iwyu
+ifeq ($(ENTERPRISE),yes)
+ $(MAKE) -C enterprise/core/src iwyu
+endif
# Not really perfect rules, but better than nothing
analyze: config.h
diff --git a/livestatus/src/Makefile.am b/livestatus/src/Makefile.am
index 9639f3d..84ead24 100644
--- a/livestatus/src/Makefile.am
+++ b/livestatus/src/Makefile.am
@@ -24,6 +24,7 @@
CLANG_VERSION ?= 5.0
RUN_CLANG_TIDY ?= run-clang-tidy-$(CLANG_VERSION).py
+IWYU_TOOL ?= iwyu_tool
BEAR ?= bear
bin_PROGRAMS = unixcat
@@ -173,6 +174,9 @@ compile_commands.json: Makefile $(wildcard *.cc *.h)
tidy: compile_commands.json
$(RUN_CLANG_TIDY) -quiet -j6
+iwyu: compile_commands.json
+ $(IWYU_TOOL) --output-format=clang -p . --
--mapping_file=$(abs_top_srcdir)/tests/iwyu-mappings/check_mk.imp
+
all-local: livestatus.o
install-data-local: