]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Workspace/WorkspaceCommon.py
BaseTools: DSC Components section support flexible PCD
[mirror_edk2.git] / BaseTools / Source / Python / Workspace / WorkspaceCommon.py
index c289b9d2b5cf10a58aabef771f2d0bae7a435531..c760e57b8f64d0699791e8361098a751b2974598 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # Common routines used by workspace\r
 #\r
-# Copyright (c) 2012 - 2016, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2012 - 2017, 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
@@ -43,13 +43,17 @@ def GetPackageList(Platform, BuildDatabase, Arch, Target, Toolchain):
 #  @param Target: Current target\r
 #  @param Toolchain: Current toolchain\r
 #  @retval: A dictionary contains instances of PcdClassObject with key (PcdCName, TokenSpaceGuid)\r
+#  @retval: A dictionary contains real GUIDs of TokenSpaceGuid\r
 #\r
 def GetDeclaredPcd(Platform, BuildDatabase, Arch, Target, Toolchain,additionalPkgs):\r
     PkgList = GetPackageList(Platform, BuildDatabase, Arch, Target, Toolchain)\r
     PkgList = set(PkgList)\r
     PkgList |= additionalPkgs\r
     DecPcds = {}\r
+    GuidDict = {}\r
     for Pkg in PkgList:\r
+        Guids = Pkg.Guids\r
+        GuidDict.update(Guids)\r
         for Pcd in Pkg.Pcds:\r
             PcdCName = Pcd[0]\r
             PcdTokenName = Pcd[1]\r
@@ -60,7 +64,7 @@ def GetDeclaredPcd(Platform, BuildDatabase, Arch, Target, Toolchain,additionalPk
                         break\r
             if (PcdCName, PcdTokenName) not in DecPcds.keys():\r
                 DecPcds[PcdCName, PcdTokenName] = Pkg.Pcds[Pcd]\r
-    return DecPcds\r
+    return DecPcds, GuidDict\r
 \r
 ## Get all dependent libraries for a module\r
 #\r