BaseTools:Override the MAKE_FLAGS by BuildOptions in DSC
authorYonghong Zhu <yonghong.zhu@intel.com>
Sat, 24 Feb 2018 13:41:13 +0000 (21:41 +0800)
committerYonghong Zhu <yonghong.zhu@intel.com>
Tue, 27 Feb 2018 07:41:02 +0000 (15:41 +0800)
The issue that *_*_*_MAKE_FLAGS doesn't work in DSC [BuildOptions]
section. It means MAKE flags can't be set in platform DSC file.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
BaseTools/Source/Python/AutoGen/AutoGen.py

index 405bfa145a22b66251b5ec92c0a2d0da8095f6cc..1787decd1d9e8127fc0f70149a63d3feebad302e 100644 (file)
@@ -1907,6 +1907,13 @@ class PlatformAutoGen(AutoGen):
                     NewOption = self.ToolDefinition["MAKE"]["FLAGS"].strip()\r
                     if NewOption != '':\r
                         self._BuildCommand += SplitOption(NewOption)\r
+                if "MAKE" in self.EdkIIBuildOption:\r
+                    if "FLAGS" in self.EdkIIBuildOption["MAKE"]:\r
+                        Flags = self.EdkIIBuildOption["MAKE"]["FLAGS"]\r
+                        if Flags.startswith('='):\r
+                            self._BuildCommand = [self._BuildCommand[0]] + [Flags[1:]]\r
+                        else:\r
+                            self._BuildCommand += [Flags]\r
         return self._BuildCommand\r
 \r
     ## Get tool chain definition\r