Run VS custom build step in new environment variable scope.

Task-number: QTBUG-32366
Change-Id: I99161b23e3d323fd88766ebe83c8bbfc1d50944e
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
David Schulz 2014-10-22 10:01:29 +02:00
parent bf200fc948
commit 80ebedecf9

View File

@ -2397,7 +2397,11 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
if (!CustomBuildTool.Description.isEmpty())
CustomBuildTool.Description += ", ";
CustomBuildTool.Description += cmd_name;
// Execute custom build steps in an environment variable scope to prevent unwanted
// side effects for downstream build steps
CustomBuildTool.CommandLine += QLatin1String("setlocal");
CustomBuildTool.CommandLine += VCToolBase::fixCommandLine(cmd.trimmed());
CustomBuildTool.CommandLine += QLatin1String("endlocal");
int space = cmd.indexOf(' ');
QFileInfo finf(cmd.left(space));
if (CustomBuildTool.ToolPath.isEmpty())