]> git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/Python/Common/GlobalData.py
BaseTools: Remove the logic SourceOverridePath
[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 gWorkspace = "."
17 gOptions = None
18 gCaseInsensitive = False
19 gAllFiles = None
20 gCommand = None
21 gSKUID_CMD = None
22
23 gGlobalDefines = {}
24 gPlatformDefines = {}
25 # PCD name and value pair for fixed at build and feature flag
26 gPlatformPcds = {}
27 # PCDs with type that are not fixed at build and feature flag
28 gPlatformOtherPcds = {}
29 gActivePlatform = None
30 gCommandLineDefines = {}
31 gEdkGlobal = {}
32 gCommandMaxLength = 4096
33 # for debug trace purpose when problem occurs
34 gProcessingFile = ''
35 gBuildingModule = ''
36 gSkuids = []
37 gDefaultStores = []
38
39 # definition for a MACRO name. used to create regular expressions below.
40 _MacroNamePattern = "[A-Z][A-Z0-9_]*"
41
42 ## Regular expression for matching macro used in DSC/DEC/INF file inclusion
43 gMacroRefPattern = re.compile("\$\(({})\)".format(_MacroNamePattern), re.UNICODE)
44 gMacroDefPattern = re.compile("^(DEFINE|EDK_GLOBAL)[ \t]+")
45 gMacroNamePattern = re.compile("^{}$".format(_MacroNamePattern))
46
47 # definition for a GUID. used to create regular expressions below.
48 _HexChar = r"[0-9a-fA-F]"
49 _GuidPattern = r"{Hex}{{8}}-{Hex}{{4}}-{Hex}{{4}}-{Hex}{{4}}-{Hex}{{12}}".format(Hex=_HexChar)
50
51 ## Regular expressions for GUID matching
52 gGuidPattern = re.compile(r'{}'.format(_GuidPattern))
53 gGuidPatternEnd = re.compile(r'{}$'.format(_GuidPattern))
54
55 ## Regular expressions for HEX matching
56 g4HexChar = re.compile(r'{}{{4}}'.format(_HexChar))
57 gHexPattern = re.compile(r'0[xX]{}+'.format(_HexChar))
58 gHexPatternAll = re.compile(r'0[xX]{}+$'.format(_HexChar))
59
60 ## Regular expressions for string identifier checking
61 gIdentifierPattern = re.compile('^[a-zA-Z][a-zA-Z0-9_]*$', re.UNICODE)
62 ## Regular expression for GUID c structure format
63 _GuidCFormatPattern = r"{{\s*0[xX]{Hex}{{1,8}}\s*,\s*0[xX]{Hex}{{1,4}}\s*,\s*0[xX]{Hex}{{1,4}}" \
64 r"\s*,\s*{{\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" \
65 r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" \
66 r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" \
67 r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}\s*}}\s*}}".format(Hex=_HexChar)
68 gGuidCFormatPattern = re.compile(r"{}".format(_GuidCFormatPattern))
69
70 #
71 # A global variable for whether current build in AutoGen phase or not.
72 #
73 gAutoGenPhase = False
74
75 #
76 # The Conf dir outside the workspace dir
77 #
78 gConfDirectory = ''
79
80 gBuildDirectory = ''
81 #
82 # The relative default database file path
83 #
84 gDatabasePath = ".cache/build.db"
85
86 #
87 # Build flag for binary build
88 #
89 gIgnoreSource = False
90
91 #
92 # FDF parser
93 #
94 gFdfParser = None
95
96 BuildOptionPcd = []
97
98 #
99 # Mixed PCD name dict
100 #
101 MixedPcd = {}
102
103 # Structure Pcd dict
104 gStructurePcd = {}
105 gPcdSkuOverrides={}
106 # Pcd name for the Pcd which used in the Conditional directives
107 gConditionalPcds = []
108
109 gUseHashCache = None
110 gBinCacheDest = None
111 gBinCacheSource = None
112 gPlatformHash = None
113 gPackageHash = {}
114 gModuleHash = {}
115 gEnableGenfdsMultiThread = False
116 gSikpAutoGenCache = set()