From 0c3e8e9947a6c13b4327dd11b20acb95441701cf Mon Sep 17 00:00:00 2001 From: Bob Feng Date: Wed, 20 Nov 2019 10:58:30 +0800 Subject: BaseTools: Enhance Basetool for incremental build BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2311 Include dependency file in Makefile to enhance incremental build Signed-off-by: Bob Feng Cc: Liming Gao Cc: Steven Shi Reviewed-by: Liming Gao --- BaseTools/Source/Python/AutoGen/ModuleAutoGen.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'BaseTools/Source/Python/AutoGen/ModuleAutoGen.py') diff --git a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py index e6d6c43810..1111d5de25 100755 --- a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py +++ b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py @@ -1129,8 +1129,31 @@ class ModuleAutoGen(AutoGen): for Inc in IncludesList: if Inc not in RetVal: RetVal.append(str(Inc)) + RetVal.extend(self.IncPathFromBuildOptions) return RetVal + @cached_property + def IncPathFromBuildOptions(self): + IncPathList = [] + for tool in self.BuildOption: + if 'FLAGS' in self.BuildOption[tool]: + flags = self.BuildOption[tool]['FLAGS'] + whitespace = False + for flag in flags.split(" "): + flag = flag.strip() + if flag.startswith(("/I","-I")): + if len(flag)>2: + if os.path.exists(flag[2:]): + IncPathList.append(flag[2:]) + else: + whitespace = True + continue + if whitespace and flag: + if os.path.exists(flag): + IncPathList.append(flag) + whitespace = False + return IncPathList + @cached_property def IncludePathLength(self): return sum(len(inc)+1 for inc in self.IncludePathList) -- cgit v1.2.3