From fae62ff21a2127df1cf2672aecd1faad95b4a6e7 Mon Sep 17 00:00:00 2001 From: Hess Chen Date: Tue, 26 Aug 2014 07:14:38 +0000 Subject: [PATCH] =?utf8?q?This=20patch=20is=20going=20to:=201.=20=20=20=20?= =?utf8?q?=20=20=20Support=20a=20force=20binary=20build=20mode=20by=20addi?= =?utf8?q?ng=20=E2=80=9C--ignore-source=E2=80=9D=20to=20command=20line=20o?= =?utf8?q?ptions.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen Reviewed-by: Yingke Liu git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15897 6f19259b-4bc3-4df7-8a09-765794883524 --- BaseTools/Source/Python/AutoGen/AutoGen.py | 2 ++ BaseTools/Source/Python/Workspace/WorkspaceDatabase.py | 5 +++++ BaseTools/Source/Python/build/build.py | 3 +++ 3 files changed, 10 insertions(+) diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py index 2b4ba52e09..8c62ac8e72 100644 --- a/BaseTools/Source/Python/AutoGen/AutoGen.py +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py @@ -3160,8 +3160,10 @@ class ModuleAutoGen(AutoGen): # dependent libraries will be created # def CreateMakeFile(self, CreateLibraryMakeFile=True): + # Ignore generating makefile when it is a binary module if self.IsBinaryModule: return + if self.IsMakeFileCreated: return diff --git a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py b/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py index 8252a3180d..638df1f6ed 100644 --- a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py +++ b/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py @@ -2051,6 +2051,11 @@ class InfBuildData(ModuleBuildClassObject): return False ## Retrieve source files def _GetSourceFiles(self): + #Ignore all source files in a binary build mode + if GlobalData.gIgnoreSource: + self._Sources = [] + return self._Sources + if self._Sources == None: self._Sources = [] RecordList = self._RawData[MODEL_EFI_SOURCE_FILE, self._Arch, self._Platform] diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index e463a57a91..2f8bfb42b1 100644 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -736,6 +736,8 @@ class Build(): self.BuildReport = BuildReport(BuildOptions.ReportFile, BuildOptions.ReportType) self.TargetTxt = TargetTxtClassObject() self.ToolDef = ToolDefClassObject() + #Set global flag for build mode + GlobalData.gIgnoreSource = BuildOptions.IgnoreSources if BuildOptions.DisableCache: self.Db = WorkspaceDatabase(":memory:") else: @@ -1903,6 +1905,7 @@ def MyOptionParser(): "This option can also be specified by setting *_*_*_BUILD_FLAGS in [BuildOptions] section of platform DSC. If they are both specified, this value "\ "will override the setting in [BuildOptions] section of platform DSC.") Parser.add_option("-N", "--no-cache", action="store_true", dest="DisableCache", default=False, help="Disable build cache mechanism") + Parser.add_option("--ignore-sources", action="store_true", dest="IgnoreSources", default=False, help="Focus to a binary build and ignore all source files") (Opt, Args)=Parser.parse_args() return (Opt, Args) -- 2.39.2