mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-28 09:59:20 -05:00
VS10: Fix working directory of consecutive custom commands (#11938)
The VS 10 msbuild tool uses a single command shell to invoke all the custom command scripts in a project. Isolate the environment and working directory of custom commands using setlocal/endlocal. The form of each command is set errlev= setlocal cd c:\work\dir if %errorlevel% neq 0 goto :cmEnd c: if %errorlevel% neq 0 goto :cmEnd command1 ... if %errorlevel% neq 0 goto :cmEnd ... commandN ... if %errorlevel% neq 0 goto :cmEnd :cmEnd endlocal & set errlev=%errorlevel% if %errlev% neq 0 goto :VCEnd so that all changes to the environment and working directory are isolated within the script and the return code is preserved.
This commit is contained in:
@@ -38,7 +38,7 @@ public:
|
||||
const char* path);
|
||||
|
||||
protected:
|
||||
virtual std::string CheckForErrorLine();
|
||||
virtual const char* ReportErrorLabel() const;
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user