]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Workspace/WorkspaceCommon.py
BaseTools: Support Structure PCD value assignment in DEC/DSC
[mirror_edk2.git] / BaseTools / Source / Python / Workspace / WorkspaceCommon.py
index 60acc914e9d262f6ab15c960ed854ed3a9272f6c..67aa530526274cc0f7a640144a92fc7a29a3eb04 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # Common routines used by workspace\r
 #\r
-# Copyright (c) 2012, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2012 - 2016, Intel Corporation. All rights reserved.<BR>\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
 # which accompanies this distribution.  The full text of the license may be found at\r
@@ -14,6 +14,8 @@
 from Common.Misc import sdict\r
 from Common.DataType import SUP_MODULE_USER_DEFINED\r
 from BuildClassObject import LibraryClassObject\r
+import Common.GlobalData as GlobalData\r
+from Workspace.BuildClassObject import StructurePcd\r
 \r
 ## Get all packages from platform for specified arch, target and toolchain\r
 #\r
@@ -47,7 +49,15 @@ def GetDeclaredPcd(Platform, BuildDatabase, Arch, Target, Toolchain):
     DecPcds = {}\r
     for Pkg in PkgList:\r
         for Pcd in Pkg.Pcds:\r
-            DecPcds[Pcd[0], Pcd[1]] = Pkg.Pcds[Pcd]\r
+            PcdCName = Pcd[0]\r
+            PcdTokenName = Pcd[1]\r
+            if GlobalData.MixedPcd:\r
+                for PcdItem in GlobalData.MixedPcd.keys():\r
+                    if (PcdCName, PcdTokenName) in GlobalData.MixedPcd[PcdItem]:\r
+                        PcdCName = PcdItem[0]\r
+                        break\r
+            if (PcdCName, PcdTokenName) not in DecPcds.keys():\r
+                DecPcds[PcdCName, PcdTokenName] = Pkg.Pcds[Pcd]\r
     return DecPcds\r
 \r
 ## Get all dependent libraries for a module\r