From 2e4fdbdda1a5ffba53ed025e6d04a16d40003325 Mon Sep 17 00:00:00 2001 From: Chih-Hung Hsieh Date: Wed, 10 Feb 2021 22:15:31 -0800 Subject: [PATCH] Do not append empty DEFAULT_TIDY_HEADER_DIRS * Default value will be empty and not work in -header-filter. Bug: 179530304 Test: make with WITH_TIDY=1 and various setting of DEFAULT_TIDY_HEADER_DIRS Change-Id: I3f784f545acd12285a5bf6dcae1bab42c9185fe7 --- core/clang/tidy.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/clang/tidy.mk b/core/clang/tidy.mk index 868f7bc88..8a408785f 100644 --- a/core/clang/tidy.mk +++ b/core/clang/tidy.mk @@ -36,7 +36,7 @@ $(lastword \ ) endef -# Default filter contains current directory $1 and DEFAULT_TIDY_HEADER_DIRS. +# Default filter contains current directory $1 and optional DEFAULT_TIDY_HEADER_DIRS. define default_tidy_header_filter - -header-filter="($(subst $(space),,$1|$(DEFAULT_TIDY_HEADER_DIRS)))" + -header-filter=$(if $(DEFAULT_TIDY_HEADER_DIRS),"($1/|$(DEFAULT_TIDY_HEADER_DIRS))",$1/) endef