2014-01-27 05:23:15 +00:00
|
|
|
## @file
|
|
|
|
|
# This file is used to define common static strings used by INF/DEC/DSC files
|
|
|
|
|
#
|
2018-03-17 07:27:39 +08:00
|
|
|
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
|
2019-04-03 16:03:11 -07:00
|
|
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
2014-01-27 05:23:15 +00:00
|
|
|
|
|
|
|
|
import re
|
|
|
|
|
|
|
|
|
|
gIsWindows = None
|
|
|
|
|
gWorkspace = "."
|
|
|
|
|
gOptions = None
|
|
|
|
|
gCaseInsensitive = False
|
|
|
|
|
gAllFiles = None
|
2016-03-31 14:05:59 +08:00
|
|
|
gCommand = None
|
2017-12-22 20:07:54 +08:00
|
|
|
gSKUID_CMD = None
|
2014-01-27 05:23:15 +00:00
|
|
|
|
|
|
|
|
gGlobalDefines = {}
|
|
|
|
|
gPlatformDefines = {}
|
|
|
|
|
# PCD name and value pair for fixed at build and feature flag
|
|
|
|
|
gPlatformPcds = {}
|
2022-03-22 15:26:11 +08:00
|
|
|
gPlatformFinalPcds = {}
|
2014-01-27 05:23:15 +00:00
|
|
|
# PCDs with type that are not fixed at build and feature flag
|
|
|
|
|
gPlatformOtherPcds = {}
|
|
|
|
|
gActivePlatform = None
|
|
|
|
|
gCommandLineDefines = {}
|
|
|
|
|
gEdkGlobal = {}
|
2016-03-16 11:06:44 +08:00
|
|
|
gCommandMaxLength = 4096
|
2014-01-27 05:23:15 +00:00
|
|
|
# for debug trace purpose when problem occurs
|
|
|
|
|
gProcessingFile = ''
|
|
|
|
|
gBuildingModule = ''
|
2017-12-22 20:07:54 +08:00
|
|
|
gSkuids = []
|
|
|
|
|
gDefaultStores = []
|
2020-07-14 13:30:40 +08:00
|
|
|
gGuidDict = {}
|
2014-01-27 05:23:15 +00:00
|
|
|
|
2018-03-17 07:27:39 +08:00
|
|
|
# definition for a MACRO name. used to create regular expressions below.
|
2023-12-06 12:27:02 -08:00
|
|
|
_MacroNamePattern = r"[A-Z][A-Z0-9_]*"
|
2018-03-17 07:27:39 +08:00
|
|
|
|
2014-01-27 05:23:15 +00:00
|
|
|
## Regular expression for matching macro used in DSC/DEC/INF file inclusion
|
2023-12-06 12:27:02 -08:00
|
|
|
gMacroRefPattern = re.compile(r"\$\(({})\)".format(_MacroNamePattern), re.UNICODE)
|
2014-01-27 05:23:15 +00:00
|
|
|
gMacroDefPattern = re.compile("^(DEFINE|EDK_GLOBAL)[ \t]+")
|
2018-03-17 07:27:39 +08:00
|
|
|
gMacroNamePattern = re.compile("^{}$".format(_MacroNamePattern))
|
2018-03-08 08:45:18 +08:00
|
|
|
|
2018-03-17 07:27:40 +08:00
|
|
|
# definition for a GUID. used to create regular expressions below.
|
2018-03-24 01:48:56 +08:00
|
|
|
_HexChar = r"[0-9a-fA-F]"
|
|
|
|
|
_GuidPattern = r"{Hex}{{8}}-{Hex}{{4}}-{Hex}{{4}}-{Hex}{{4}}-{Hex}{{12}}".format(Hex=_HexChar)
|
2018-03-17 07:27:40 +08:00
|
|
|
|
|
|
|
|
## Regular expressions for GUID matching
|
|
|
|
|
gGuidPattern = re.compile(r'{}'.format(_GuidPattern))
|
|
|
|
|
gGuidPatternEnd = re.compile(r'{}$'.format(_GuidPattern))
|
|
|
|
|
|
2018-03-17 07:27:45 +08:00
|
|
|
## Regular expressions for HEX matching
|
2018-03-29 00:04:58 +08:00
|
|
|
g4HexChar = re.compile(r'{}{{4}}'.format(_HexChar))
|
2018-03-17 07:27:45 +08:00
|
|
|
gHexPattern = re.compile(r'0[xX]{}+'.format(_HexChar))
|
2018-04-20 23:51:44 +08:00
|
|
|
gHexPatternAll = re.compile(r'0[xX]{}+$'.format(_HexChar))
|
2018-03-29 00:04:58 +08:00
|
|
|
|
2018-04-04 06:34:04 +08:00
|
|
|
## Regular expressions for string identifier checking
|
|
|
|
|
gIdentifierPattern = re.compile('^[a-zA-Z][a-zA-Z0-9_]*$', re.UNICODE)
|
2018-08-08 14:14:20 +08:00
|
|
|
## Regular expression for GUID c structure format
|
|
|
|
|
_GuidCFormatPattern = r"{{\s*0[xX]{Hex}{{1,8}}\s*,\s*0[xX]{Hex}{{1,4}}\s*,\s*0[xX]{Hex}{{1,4}}" \
|
|
|
|
|
r"\s*,\s*{{\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" \
|
|
|
|
|
r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" \
|
|
|
|
|
r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}" \
|
|
|
|
|
r"\s*,\s*0[xX]{Hex}{{1,2}}\s*,\s*0[xX]{Hex}{{1,2}}\s*}}\s*}}".format(Hex=_HexChar)
|
|
|
|
|
gGuidCFormatPattern = re.compile(r"{}".format(_GuidCFormatPattern))
|
2018-04-04 06:34:04 +08:00
|
|
|
|
2014-01-27 05:23:15 +00:00
|
|
|
#
|
|
|
|
|
# A global variable for whether current build in AutoGen phase or not.
|
|
|
|
|
#
|
|
|
|
|
gAutoGenPhase = False
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# The Conf dir outside the workspace dir
|
|
|
|
|
#
|
|
|
|
|
gConfDirectory = ''
|
2020-01-10 16:29:45 +08:00
|
|
|
gCmdConfDir = ''
|
2017-10-13 10:47:24 +08:00
|
|
|
gBuildDirectory = ''
|
2014-01-27 05:23:15 +00:00
|
|
|
#
|
|
|
|
|
# The relative default database file path
|
|
|
|
|
#
|
|
|
|
|
gDatabasePath = ".cache/build.db"
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Build flag for binary build
|
|
|
|
|
#
|
|
|
|
|
gIgnoreSource = False
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# FDF parser
|
|
|
|
|
#
|
|
|
|
|
gFdfParser = None
|
2014-08-28 13:53:34 +00:00
|
|
|
|
2016-02-25 16:13:31 +08:00
|
|
|
BuildOptionPcd = []
|
2016-03-23 17:34:13 +08:00
|
|
|
|
2016-04-12 10:31:55 +08:00
|
|
|
#
|
|
|
|
|
# Mixed PCD name dict
|
|
|
|
|
#
|
|
|
|
|
MixedPcd = {}
|
|
|
|
|
|
2017-11-24 14:30:11 +08:00
|
|
|
# Structure Pcd dict
|
|
|
|
|
gStructurePcd = {}
|
2019-02-18 17:53:09 +08:00
|
|
|
gPcdSkuOverrides={}
|
2016-03-23 17:34:13 +08:00
|
|
|
# Pcd name for the Pcd which used in the Conditional directives
|
|
|
|
|
gConditionalPcds = []
|
2017-09-19 14:31:09 +08:00
|
|
|
|
|
|
|
|
gUseHashCache = None
|
|
|
|
|
gBinCacheDest = None
|
|
|
|
|
gBinCacheSource = None
|
|
|
|
|
gPlatformHash = None
|
2019-11-19 16:17:00 +08:00
|
|
|
gPlatformHashFile = None
|
|
|
|
|
gPackageHash = None
|
|
|
|
|
gPackageHashFile = None
|
|
|
|
|
gModuleHashFile = None
|
|
|
|
|
gCMakeHashFile = None
|
|
|
|
|
gHashChainStatus = None
|
|
|
|
|
gModulePreMakeCacheStatus = None
|
|
|
|
|
gModuleMakeCacheStatus = None
|
|
|
|
|
gFileHashDict = None
|
|
|
|
|
gModuleAllCacheStatus = None
|
|
|
|
|
gModuleCacheHit = None
|
|
|
|
|
|
2019-09-06 21:22:58 +08:00
|
|
|
gEnableGenfdsMultiThread = True
|
2018-07-02 09:15:47 +08:00
|
|
|
gSikpAutoGenCache = set()
|
2019-08-15 22:26:17 +08:00
|
|
|
# Common lock for the file access in multiple process AutoGens
|
|
|
|
|
file_lock = None
|
2024-06-14 14:07:33 -07:00
|
|
|
gStackCookieValues32 = []
|
|
|
|
|
gStackCookieValues64 = []
|