]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Common/GlobalData.py
BaseTools: Library hashing fix and optimization for --hash feature
[mirror_edk2.git] / BaseTools / Source / Python / Common / GlobalData.py
index f58dc5a8dda225a973f57c20abdb2508c28e866c..95e28a988f1be13119064cf90177701e13f07d6f 100644 (file)
@@ -2,24 +2,12 @@
 # This file is used to define common static strings used by INF/DEC/DSC files\r
 #\r
 # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution.  The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+# SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 import re\r
 \r
 gIsWindows = None\r
-\r
-gEdkCompatibilityPkg = "EdkCompatibilityPkg"\r
 gWorkspace = "."\r
-gEdkSource = "EdkCompatibilityPkg"\r
-gEfiSource = "."\r
-gEcpSource = "EdkCompatibilityPkg"\r
-\r
 gOptions = None\r
 gCaseInsensitive = False\r
 gAllFiles = None\r
@@ -35,7 +23,6 @@ gPlatformOtherPcds = {}
 gActivePlatform = None\r
 gCommandLineDefines = {}\r
 gEdkGlobal = {}\r
-gOverrideDir = {}\r
 gCommandMaxLength = 4096\r
 # for debug trace purpose when problem occurs\r
 gProcessingFile = ''\r
@@ -62,9 +49,17 @@ gGuidPatternEnd = re.compile(r'{}$'.format(_GuidPattern))
 ## Regular expressions for HEX matching\r
 g4HexChar = re.compile(r'{}{{4}}'.format(_HexChar))\r
 gHexPattern = re.compile(r'0[xX]{}+'.format(_HexChar))\r
+gHexPatternAll = re.compile(r'0[xX]{}+$'.format(_HexChar))\r
 \r
 ## Regular expressions for string identifier checking\r
 gIdentifierPattern = re.compile('^[a-zA-Z][a-zA-Z0-9_]*$', re.UNICODE)\r
+## Regular expression for GUID c structure format\r
+_GuidCFormatPattern = r"{{\s*0[xX]{Hex}{{1,8}}\s*,\s*0[xX]{Hex}{{1,4}}\s*,\s*0[xX]{Hex}{{1,4}}" \\r
+                      r"\s*,\s*{{\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" \\r
+                      r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" \\r
+                      r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" \\r
+                      r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}\s*}}\s*}}".format(Hex=_HexChar)\r
+gGuidCFormatPattern = re.compile(r"{}".format(_GuidCFormatPattern))\r
 \r
 #\r
 # A global variable for whether current build in AutoGen phase or not.\r
@@ -92,13 +87,6 @@ gIgnoreSource = False
 #\r
 gFdfParser = None\r
 \r
-#\r
-# If a module is built more than once with different PCDs or library classes\r
-# a temporary INF file with same content is created, the temporary file is removed\r
-# when build exits.\r
-#\r
-gTempInfs = []\r
-\r
 BuildOptionPcd = []\r
 \r
 #\r
@@ -108,7 +96,7 @@ MixedPcd = {}
 \r
 # Structure Pcd dict\r
 gStructurePcd = {}\r
-\r
+gPcdSkuOverrides={}\r
 # Pcd name for the Pcd which used in the Conditional directives\r
 gConditionalPcds = []\r
 \r
@@ -119,3 +107,14 @@ gPlatformHash = None
 gPackageHash = {}\r
 gModuleHash = {}\r
 gEnableGenfdsMultiThread = False\r
+gSikpAutoGenCache = set()\r
+\r
+# Dictionary for tracking Module build status as success or failure\r
+# False -> Fail : True -> Success\r
+gModuleBuildTracking = dict()\r
+\r
+# Dictionary of booleans that dictate whether a module or\r
+# library can be skiped\r
+# Top Dict:     Key: Arch Type              Value: Dictionary\r
+# Second Dict:  Key: Module\Library Name    Value: True\False\r
+gBuildHashSkipTracking = dict()\r