Make [-D Macros] as optional argument for GenCfgOpt
authoredk2-devel On Behalf Of rthomaiy <[mailto:edk2-devel-bounces@lists.01.org]>
Wed, 1 Mar 2017 06:57:58 +0000 (14:57 +0800)
committerJiewen Yao <jiewen.yao@intel.com>
Wed, 1 Mar 2017 06:57:58 +0000 (14:57 +0800)
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Richard Thomaiyar <richard.marian.thomaiyar@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
IntelFsp2Pkg/Tools/GenCfgOpt.py

index 7658b7f..d8038e9 100644 (file)
@@ -1428,11 +1428,12 @@ def Main():
             else:\r
                 OutFile = sys.argv[4]\r
                 Start = 5\r
-            GenCfgOpt.ParseBuildMode(sys.argv[3])\r
-            if GenCfgOpt.ParseMacros(sys.argv[Start:]) != 0:\r
-                print "ERROR: Macro parsing failed !"\r
-                return 3\r
+            if argc > Start:\r
+                if GenCfgOpt.ParseMacros(sys.argv[Start:]) != 0:\r
+                    print "ERROR: Macro parsing failed !"\r
+                    return 3\r
 \r
+        GenCfgOpt.ParseBuildMode(sys.argv[3])\r
         FvDir = sys.argv[3]\r
         if not os.path.exists(FvDir):\r
             os.makedirs(FvDir)\r