Added -x to pass SKU ID from command line
[people/mcb30/basetools.git] / Source / Python / Workspace / WorkspaceBuild.py
index 6ec16eb..799b209 100644 (file)
@@ -56,11 +56,11 @@ class ItemBuild(object):
         self.ModuleDatabase          = {}\r
 \r
 class WorkspaceBuild(object):\r
-    def __init__(self, ActivePlatform, WorkspaceDir, Reparse=False):\r
+    def __init__(self, ActivePlatform, WorkspaceDir, Reparse=False, SkuId=''):\r
         self.WorkspaceDir            = NormPath(WorkspaceDir)\r
         self.SupArchList             = []\r
         self.BuildTarget             = []\r
-        self.SkuId                   = ''\r
+        self.SkuId                   = SkuId\r
         self.Fdf                     = ''\r
         self.FdTargetList            = []\r
         self.FvTargetList            = []\r
@@ -101,10 +101,13 @@ class WorkspaceBuild(object):
         Platform = self.Db.BuildObject[self.DscFileName, MODEL_FILE_DSC, 'COMMON']\r
         self.SupArchList = Platform.SupArchList\r
         self.BuildTarget = Platform.BuildTargets\r
-        self.SkuId = Platform.SkuName\r
         self.Fdf = Platform.FlashDefinition\r
+        if self.SkuId == '':\r
+            self.SkuId = Platform.SkuName\r
         for Arch in self.SupArchList:\r
-            self.Build[Arch].PlatformDatabase[self.DscFileName] = self.Db.BuildObject[self.DscFileName, MODEL_FILE_DSC, Arch]\r
+            Platform = self.Db.BuildObject[self.DscFileName, MODEL_FILE_DSC, Arch]\r
+            Platform.SkuName = self.SkuId\r
+            self.Build[Arch].PlatformDatabase[self.DscFileName] = Platform\r
     \r
     ## GenBuildDatabase\r
     #\r