Clear EFI_SOURCE and EDK_SOURCE environment when workspace is changed.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9814 6f19259b-4bc3-4df7-8a09-765794883524
diff --git a/edksetup.bat b/edksetup.bat
index d81e7fd..7c7f52f 100755
--- a/edksetup.bat
+++ b/edksetup.bat
@@ -29,8 +29,21 @@
@REM
pushd .
cd %~dp0
-set WORKSPACE=%CD%
+if defined WORKSPACE (
+ if %WORKSPACE% == %CD% (
+ @REM workspace is not changed.
+ @goto ParseArgs
+ )
+)
+
+@REM set new workspace
+@REM clear EFI_SOURCE and EDK_SOURCE for the new workspace
+set WORKSPACE=%CD%
+set EFI_SOURCE=
+set EDK_SOURCE=
+
+:ParseArgs
@if /I "%1"=="-h" goto Usage
@if /I "%1"=="-help" goto Usage
@if /I "%1"=="--help" goto Usage