]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/Common/GlobalData.py
BaseTool: Add cache for the result of SkipAutogen.
[mirror_edk2.git] / BaseTools / Source / Python / Common / GlobalData.py
index 57ba0546ed3b46d3616f0be28c15b56e84cbb023..fac7cde708f6d63e7ffec3c8d7d075489b486969 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to define common static strings used by INF/DEC/DSC files\r
 #\r
-# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>\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
@@ -24,6 +24,7 @@ gOptions = None
 gCaseInsensitive = False\r
 gAllFiles = None\r
 gCommand = None\r
+gSKUID_CMD = None\r
 \r
 gGlobalDefines = {}\r
 gPlatformDefines = {}\r
@@ -39,13 +40,33 @@ gCommandMaxLength = 4096
 # for debug trace purpose when problem occurs\r
 gProcessingFile = ''\r
 gBuildingModule = ''\r
+gSkuids = []\r
+gDefaultStores = []\r
+\r
+# definition for a MACRO name.  used to create regular expressions below.\r
+_MacroNamePattern = "[A-Z][A-Z0-9_]*"\r
 \r
 ## Regular expression for matching macro used in DSC/DEC/INF file inclusion\r
-gMacroRefPattern = re.compile("\$\(([A-Z][_A-Z0-9]*)\)", re.UNICODE)\r
+gMacroRefPattern = re.compile("\$\(({})\)".format(_MacroNamePattern), re.UNICODE)\r
 gMacroDefPattern = re.compile("^(DEFINE|EDK_GLOBAL)[ \t]+")\r
-gMacroNamePattern = re.compile("^[A-Z][A-Z0-9_]*$")\r
-# C-style wide string pattern\r
-gWideStringPattern = re.compile('(\W|\A)L"')\r
+gMacroNamePattern = re.compile("^{}$".format(_MacroNamePattern))\r
+\r
+# definition for a GUID.  used to create regular expressions below.\r
+_HexChar = r"[0-9a-fA-F]"\r
+_GuidPattern = r"{Hex}{{8}}-{Hex}{{4}}-{Hex}{{4}}-{Hex}{{4}}-{Hex}{{12}}".format(Hex=_HexChar)\r
+\r
+## Regular expressions for GUID matching\r
+gGuidPattern = re.compile(r'{}'.format(_GuidPattern))\r
+gGuidPatternEnd = re.compile(r'{}$'.format(_GuidPattern))\r
+\r
+## 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
+\r
 #\r
 # A global variable for whether current build in AutoGen phase or not.\r
 #\r
@@ -72,13 +93,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
@@ -99,3 +113,4 @@ gPlatformHash = None
 gPackageHash = {}\r
 gModuleHash = {}\r
 gEnableGenfdsMultiThread = False\r
+gSikpAutoGenCache = set()\r