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