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