summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
diff options
context:
space:
mode:
authorBob Feng <bob.c.feng@intel.com>2019-11-20 10:58:30 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2019-12-10 01:31:55 +0000
commit0c3e8e9947a6c13b4327dd11b20acb95441701cf (patch)
tree77e1d0b396820ccd873185bebc42a75484f82978 /BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
parentcb277815d5ea92718eed2d334641451ce65b0ff5 (diff)
downloadedk2-0c3e8e9947a6c13b4327dd11b20acb95441701cf.tar.gz
edk2-0c3e8e9947a6c13b4327dd11b20acb95441701cf.tar.bz2
edk2-0c3e8e9947a6c13b4327dd11b20acb95441701cf.zip
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 <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Steven Shi <steven.shi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/ModuleAutoGen.py')
-rwxr-xr-xBaseTools/Source/Python/AutoGen/ModuleAutoGen.py23
1 files changed, 23 insertions, 0 deletions
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,9 +1129,32 @@ 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)