]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/Python/Common/GlobalData.py
BaseTools: use set instead of list for a variable to be used with in
[mirror_edk2.git] / BaseTools / Source / Python / Common / GlobalData.py
1 ## @file
2 # This file is used to define common static strings used by INF/DEC/DSC files
3 #
4 # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
5 # This program and the accompanying materials
6 # are licensed and made available under the terms and conditions of the BSD License
7 # which accompanies this distribution. The full text of the license may be found at
8 # http://opensource.org/licenses/bsd-license.php
9 #
10 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 import re
14
15 gIsWindows = None
16
17 gEdkCompatibilityPkg = "EdkCompatibilityPkg"
18 gWorkspace = "."
19 gEdkSource = "EdkCompatibilityPkg"
20 gEfiSource = "."
21 gEcpSource = "EdkCompatibilityPkg"
22
23 gOptions = None
24 gCaseInsensitive = False
25 gAllFiles = None
26 gCommand = None
27 gSKUID_CMD = None
28
29 gGlobalDefines = {}
30 gPlatformDefines = {}
31 # PCD name and value pair for fixed at build and feature flag
32 gPlatformPcds = {}
33 # PCDs with type that are not fixed at build and feature flag
34 gPlatformOtherPcds = {}
35 gActivePlatform = None
36 gCommandLineDefines = {}
37 gEdkGlobal = {}
38 gOverrideDir = {}
39 gCommandMaxLength = 4096
40 # for debug trace purpose when problem occurs
41 gProcessingFile = ''
42 gBuildingModule = ''
43 gSkuids = []
44 gDefaultStores = []
45
46 # definition for a MACRO name. used to create regular expressions below.
47 _MacroNamePattern = "[A-Z][A-Z0-9_]*"
48
49 ## Regular expression for matching macro used in DSC/DEC/INF file inclusion
50 gMacroRefPattern = re.compile("\$\(({})\)".format(_MacroNamePattern), re.UNICODE)
51 gMacroDefPattern = re.compile("^(DEFINE|EDK_GLOBAL)[ \t]+")
52 gMacroNamePattern = re.compile("^{}$".format(_MacroNamePattern))
53
54 # definition for a GUID. used to create regular expressions below.
55 _HexChar = r"[0-9a-fA-F]"
56 _GuidPattern = r"{Hex}{{8}}-{Hex}{{4}}-{Hex}{{4}}-{Hex}{{4}}-{Hex}{{12}}".format(Hex=_HexChar)
57
58 ## Regular expressions for GUID matching
59 gGuidPattern = re.compile(r'{}'.format(_GuidPattern))
60 gGuidPatternEnd = re.compile(r'{}$'.format(_GuidPattern))
61
62 ## Regular expressions for HEX matching
63 g4HexChar = re.compile(r'{}{{4}}'.format(_HexChar))
64 gHexPattern = re.compile(r'0[xX]{}+'.format(_HexChar))
65
66 ## Regular expressions for string identifier checking
67 gIdentifierPattern = re.compile('^[a-zA-Z][a-zA-Z0-9_]*$', re.UNICODE)
68
69 #
70 # A global variable for whether current build in AutoGen phase or not.
71 #
72 gAutoGenPhase = False
73
74 #
75 # The Conf dir outside the workspace dir
76 #
77 gConfDirectory = ''
78
79 gBuildDirectory = ''
80 #
81 # The relative default database file path
82 #
83 gDatabasePath = ".cache/build.db"
84
85 #
86 # Build flag for binary build
87 #
88 gIgnoreSource = False
89
90 #
91 # FDF parser
92 #
93 gFdfParser = None
94
95 #
96 # If a module is built more than once with different PCDs or library classes
97 # a temporary INF file with same content is created, the temporary file is removed
98 # when build exits.
99 #
100 gTempInfs = []
101
102 BuildOptionPcd = []
103
104 #
105 # Mixed PCD name dict
106 #
107 MixedPcd = {}
108
109 # Structure Pcd dict
110 gStructurePcd = {}
111
112 # Pcd name for the Pcd which used in the Conditional directives
113 gConditionalPcds = []
114
115 gUseHashCache = None
116 gBinCacheDest = None
117 gBinCacheSource = None
118 gPlatformHash = None
119 gPackageHash = {}
120 gModuleHash = {}
121 gEnableGenfdsMultiThread = False