summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/AutoGen/GenMake.py
diff options
context:
space:
mode:
authorRodriguez, Christian <christian.rodriguez@intel.com>2019-08-12 23:32:11 +0800
committerFeng, Bob C <bob.c.feng@intel.com>2019-08-14 10:59:08 +0800
commit82407bd129dca8ec6d96e85f541b0974c8d7e087 (patch)
treeaede60265fc41b5bdbc8abf699ef337b72d63c76 /BaseTools/Source/Python/AutoGen/GenMake.py
parent2b4c07bc22af6caec94645e1f7e2a23646dc1333 (diff)
downloadedk2-82407bd129dca8ec6d96e85f541b0974c8d7e087.tar.gz
edk2-82407bd129dca8ec6d96e85f541b0974c8d7e087.tar.bz2
edk2-82407bd129dca8ec6d96e85f541b0974c8d7e087.zip
BaseTools: Fix checking for Sources section in INF file
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1804 The check to see if [Sources] section lists all the header type files of a module is missing the exclusion of source files that fall under the scope of Package includes. This change adds the exclusions. Signed-off-by: Christian Rodriguez <christian.rodriguez@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Tested-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/AutoGen/GenMake.py')
-rw-r--r--BaseTools/Source/Python/AutoGen/GenMake.py25
1 files changed, 22 insertions, 3 deletions
diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py
index 5802ae5ae4..499ef82aea 100644
--- a/BaseTools/Source/Python/AutoGen/GenMake.py
+++ b/BaseTools/Source/Python/AutoGen/GenMake.py
@@ -906,8 +906,14 @@ cleanlib:
self._AutoGenObject.IncludePathList + self._AutoGenObject.BuildOptionIncPathList
)
+ # Get a set of unique package includes from MetaFile
+ parentMetaFileIncludes = set()
+ for aInclude in self._AutoGenObject.PackageIncludePathList:
+ aIncludeName = str(aInclude)
+ parentMetaFileIncludes.add(aIncludeName.lower())
+
# Check if header files are listed in metafile
- # Get a list of unique module header source files from MetaFile
+ # Get a set of unique module header source files from MetaFile
headerFilesInMetaFileSet = set()
for aFile in self._AutoGenObject.SourceFileList:
aFileName = str(aFile)
@@ -915,24 +921,37 @@ cleanlib:
continue
headerFilesInMetaFileSet.add(aFileName.lower())
- # Get a list of unique module autogen files
+ # Get a set of unique module autogen files
localAutoGenFileSet = set()
for aFile in self._AutoGenObject.AutoGenFileList:
localAutoGenFileSet.add(str(aFile).lower())
- # Get a list of unique module dependency header files
+ # Get a set of unique module dependency header files
# Exclude autogen files and files not in the source directory
+ # and files that are under the package include list
headerFileDependencySet = set()
localSourceDir = str(self._AutoGenObject.SourceDir).lower()
for Dependency in FileDependencyDict.values():
for aFile in Dependency:
aFileName = str(aFile).lower()
+ # Exclude non-header files
if not aFileName.endswith('.h'):
continue
+ # Exclude autogen files
if aFileName in localAutoGenFileSet:
continue
+ # Exclude include out of local scope
if localSourceDir not in aFileName:
continue
+ # Exclude files covered by package includes
+ pathNeeded = True
+ for aIncludePath in parentMetaFileIncludes:
+ if aIncludePath in aFileName:
+ pathNeeded = False
+ break
+ if not pathNeeded:
+ continue
+ # Keep the file to be checked
headerFileDependencySet.add(aFileName)
# Ensure that gModuleBuildTracking has been initialized per architecture