summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py
diff options
context:
space:
mode:
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)