]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Fix incorrect formatting of GenFds command dictionary
authorFelix Polyudov <felixp@ami.com>
Wed, 16 Jan 2019 16:51:16 +0000 (00:51 +0800)
committerFeng, Bob C <bob.c.feng@intel.com>
Mon, 21 Jan 2019 10:03:29 +0000 (18:03 +0800)
GenFdsCommand returned dictionary with elements that
are not compatible with GenFdsApi.
As a result the following options were not processed by GenFdsApi:
-v, -q, -d, --genfds-multi-thread, --ignore-sources
The issue is introduced by commit b3497bad1221704a5dbc5da0b10f42625f1ad2ed.

V2: Remove EFI_SOURCE references

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

index 5149bdd6ece19c91e7312b328efd5e20376b7835..6005b35a15203c0b2beed817420210c332d03938 100644 (file)
@@ -3,6 +3,7 @@
 #\r
 # Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>\r
 # Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.<BR>\r
+# Copyright (c) 2019, American Megatrends, Inc. All rights reserved.<BR>\r
 #\r
 # This program and the accompanying materials\r
 # are licensed and made available under the terms and conditions of the BSD License\r
@@ -935,7 +936,56 @@ class WorkspaceAutoGen(AutoGen):
 \r
     @property\r
     def GenFdsCommandDict(self):\r
-        return GenMake.TopLevelMakefile(self)._TemplateDict\r
+        FdsCommandDict = {}\r
+        LogLevel = EdkLogger.GetLevel()\r
+        if LogLevel == EdkLogger.VERBOSE:\r
+            FdsCommandDict["verbose"] = True\r
+        elif LogLevel <= EdkLogger.DEBUG_9:\r
+            FdsCommandDict["debug"] = LogLevel - 1\r
+        elif LogLevel == EdkLogger.QUIET:\r
+            FdsCommandDict["quiet"] = True\r
+\r
+        if GlobalData.gEnableGenfdsMultiThread:\r
+            FdsCommandDict["GenfdsMultiThread"] = True\r
+        if GlobalData.gIgnoreSource:\r
+            FdsCommandDict["IgnoreSources"] = True\r
+\r
+        FdsCommandDict["OptionPcd"] = []\r
+        for pcd in GlobalData.BuildOptionPcd:\r
+            if pcd[2]:\r
+                pcdname = '.'.join(pcd[0:3])\r
+            else:\r
+                pcdname = '.'.join(pcd[0:2])\r
+            if pcd[3].startswith('{'):\r
+                FdsCommandDict["OptionPcd"].append(pcdname + '=' + 'H' + '"' + pcd[3] + '"')\r
+            else:\r
+                FdsCommandDict["OptionPcd"].append(pcdname + '=' + pcd[3])\r
+\r
+        MacroList = []\r
+        # macros passed to GenFds\r
+        MacroDict = {}\r
+        MacroDict.update(GlobalData.gGlobalDefines)\r
+        MacroDict.update(GlobalData.gCommandLineDefines)\r
+        for MacroName in MacroDict:\r
+            if MacroDict[MacroName] != "":\r
+                MacroList.append('"%s=%s"' % (MacroName, MacroDict[MacroName].replace('\\', '\\\\')))\r
+            else:\r
+                MacroList.append('"%s"' % MacroName)\r
+        FdsCommandDict["macro"] = MacroList\r
+\r
+        FdsCommandDict["fdf_file"] = [self.FdfFile]\r
+        FdsCommandDict["build_target"] = self.BuildTarget\r
+        FdsCommandDict["toolchain_tag"] = self.ToolChain\r
+        FdsCommandDict["active_platform"] = str(self)\r
+\r
+        FdsCommandDict["conf_directory"] = GlobalData.gConfDirectory\r
+        FdsCommandDict["build_architecture_list"] = ','.join(self.ArchList)\r
+        FdsCommandDict["platform_build_directory"] = self.BuildDir\r
+\r
+        FdsCommandDict["fd"] = self.FdTargetList\r
+        FdsCommandDict["fv"] = self.FvTargetList\r
+        FdsCommandDict["cap"] = self.CapTargetList\r
+        return FdsCommandDict\r
 \r
     ## Create makefile for the platform and modules in it\r
     #\r