mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-31 01:24:12 +02:00
BaseTools/AutoGen: GenMake response file quotes strings
If command line options are moved into a response file of a GCC family build, then the file path separators are converted from '\' to '/'. However, this can corrupt command line options that are quoted strings. Update GenMake to no convert '\' to '/' in quoted strings. Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
This commit is contained in:
parent
15a7d311a8
commit
62b0698309
@ -899,9 +899,20 @@ cleanlib:
|
|||||||
break
|
break
|
||||||
|
|
||||||
if self._AutoGenObject.ToolChainFamily == 'GCC':
|
if self._AutoGenObject.ToolChainFamily == 'GCC':
|
||||||
RespDict[Key] = Value.replace('\\', '/')
|
#
|
||||||
else:
|
# Replace '\' with '/' in the response file.
|
||||||
RespDict[Key] = Value
|
# Skip content within "" or \"\"
|
||||||
|
#
|
||||||
|
ValueList = re.split(r'("|\\"|\s+)', Value)
|
||||||
|
Skip = False
|
||||||
|
for i, v in enumerate(ValueList):
|
||||||
|
if v in ('"', '\\"'):
|
||||||
|
Skip = not Skip
|
||||||
|
elif not Skip:
|
||||||
|
ValueList[i] = v.replace('\\', '/')
|
||||||
|
Value = ''.join(ValueList)
|
||||||
|
RespDict[Key] = Value
|
||||||
|
|
||||||
for Target in BuildTargets:
|
for Target in BuildTargets:
|
||||||
for i, SingleCommand in enumerate(BuildTargets[Target].Commands):
|
for i, SingleCommand in enumerate(BuildTargets[Target].Commands):
|
||||||
if FlagDict[Flag]['Macro'] in SingleCommand:
|
if FlagDict[Flag]['Macro'] in SingleCommand:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user