Skip to content

Commit

Permalink
Run VS custom build step in new environment variable scope.
Browse files Browse the repository at this point in the history
Task-number: QTBUG-32366
Change-Id: I99161b23e3d323fd88766ebe83c8bbfc1d50944e
Reviewed-by: Joerg Bornemann <[email protected]>
  • Loading branch information
davschul committed Oct 23, 2014
1 parent bf200fc commit 80ebede
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions qmake/generators/win32/msvc_objectmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 80ebede

Please sign in to comment.