BaseTools:Enhance the way to handling included dsc file

BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=2400

In Dsc Parser, included dsc file is parsed always no matter
if its condition is False

  gUefiOvmfPkgTokenSpaceGuid.test1|FALSE
!if gUefiOvmfPkgTokenSpaceGuid.test1 == FALSE
  !include OvmfPkg/test1.dsc
!else
  !include OvmfPkg/test2.dsc
!endif

The patch avoids processing redundant dsc files and improves
the way Tool handles them.

In the above case, since the conditional result is FALSE,
"test2.dsc" is not parsed.

Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>

Cc: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
This commit is contained in:
Fan, ZhijuX 2019-12-03 17:04:25 +08:00 committed by mergify[bot]
parent 9c33f16f8c
commit c8ff8e05af
1 changed files with 36 additions and 35 deletions

View File

@ -1612,6 +1612,7 @@ class DscParser(MetaFileParser):
# First search the include file under the same directory as DSC file
#
IncludedFile1 = PathClass(IncludedFile, self.MetaFile.Dir)
if self._Enabled:
ErrorCode, ErrorInfo1 = IncludedFile1.Validate()
if ErrorCode != 0:
#