From 146005b2c31db3399401fec49e53b781b42d189d Mon Sep 17 00:00:00 2001 From: Shubhi Jain Date: Thu, 9 Jun 2022 10:06:47 -0700 Subject: [PATCH] ANDROID: Add clang-tidy/clang-analyzer support for mixed build environment Running clang-tidy/clang-analyzer with MAKE_GOALS fails in a mixed build environment because archive files pertaining to the vmlinux are expected as input to make rule. This would cause a failure when generating compile_commands.json file, so we need to indicate that we are running a mixed build environment when running clang-tidy/ clang-analyzer. Bug: 233781076 Change-Id: I67afee105eb52c245aab04172c5a397bd8593532 Signed-off-by: Shubhi Jain --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8df4712b73cb..842e74c075fa 100644 --- a/Makefile +++ b/Makefile @@ -1925,7 +1925,7 @@ quiet_cmd_gen_compile_commands = GEN $@ cmd_gen_compile_commands = $(PYTHON3) $< -a $(AR) -o $@ $(filter-out $<, $(real-prereqs)) $(extmod_prefix)compile_commands.json: scripts/clang-tools/gen_compile_commands.py \ - $(if $(KBUILD_EXTMOD),,$(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS)) \ + $(if $(KBUILD_EXTMOD)$(KBUILD_MIXED_TREE),,$(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS)) \ $(if $(CONFIG_MODULES), $(MODORDER)) FORCE $(call if_changed,gen_compile_commands)