]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Report Error if use SET in Dsc
authorFeng, Bob C <bob.c.feng@intel.com>
Wed, 2 Jan 2019 08:09:46 +0000 (16:09 +0800)
committerFeng, Bob C <bob.c.feng@intel.com>
Fri, 11 Jan 2019 02:51:19 +0000 (10:51 +0800)
Build tool do not support SET syntax in DSC.
If the SET statement is used in DSC, build tool just ignore it.
That behavior confused some users that
they think SET statement works in DSC like in FDF.
To avoid such confusion, build tool report ERROR
if there is "SET" statement in Dsc file.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Reviewed-by: Cc: Liming Gao <liming.gao@intel.com>
BaseTools/Source/Python/Workspace/MetaFileParser.py

index 02c8d7bbb58ca7f46bf1423d3a49394f1bb9baad..9e524fefa547823fc5e74305a1d82b4d1bdafb61 100644 (file)
@@ -978,6 +978,11 @@ class DscParser(MetaFileParser):
             self._ItemType = SectionType\r
 \r
             self._ValueList = ['', '', '']\r
+            # "SET pcd = pcd_expression" syntax is not supported in Dsc file.\r
+            if self._CurrentLine.upper().strip().startswith("SET "):\r
+                EdkLogger.error('Parser', FORMAT_INVALID, '''"SET pcd = pcd_expression" syntax is not support in Dsc file''',\r
+                                ExtraData=self._CurrentLine,\r
+                                File=self.MetaFile, Line=self._LineIndex + 1)\r
             self._SectionParser[SectionType](self)\r
             if self._ValueList is None:\r
                 continue\r