From 33772a47104cf2cfafb0ba8665c925cd1cf360fa Mon Sep 17 00:00:00 2001 From: Stinkfist0 Date: Sat, 6 Feb 2016 18:48:18 +0200 Subject: [PATCH] run-cmake.bat & build-all.cmd: fix cmake arguments parsing when arguments passed for the batch scripts --- win/build-all.cmd | 4 ++-- win/run-cmake.bat | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/win/build-all.cmd b/win/build-all.cmd index 00f9e779a7..c907de928a 100644 --- a/win/build-all.cmd +++ b/win/build-all.cmd @@ -36,8 +36,8 @@ del .\y.txt if not %ERRORLEVEL%==0 goto :EOF :: Same trick as in run-cmake.bat set ARGUMENTS=%* -call set ARGUMENTS=%%ARGUMENTS:%1=%% -call set ARGUMENTS=%%ARGUMENTS:%2=%% +if not (%1)==() call set ARGUMENTS=%%ARGUMENTS:%1=%% +if not (%2)==() call set ARGUMENTS=%%ARGUMENTS:%2=%% call .\run-cmake %1 %ARGUMENTS% if not %ERRORLEVEL%==0 goto :EOF call .\build-ifcopenshell %1 %2 diff --git a/win/run-cmake.bat b/win/run-cmake.bat index 61371539e2..d9fb548743 100644 --- a/win/run-cmake.bat +++ b/win/run-cmake.bat @@ -29,8 +29,10 @@ IF NOT %ERRORLEVEL%==0 GOTO :Error :: As CMake options are typically of format -DSOMETHING:BOOL=ON or -DSOMETHING=1, i.e. they contain an equal sign, :: they will mess up the batch file argument parsing if the arguments are passed on by splitting them %2 %3 %4 %5 :: %6 %7 %8 %9. Work around that, http://scripts.dragon-it.co.uk/scripts.nsf/docs/batch-search-replace-substitute -set ARGUMENTS=%* -call set ARGUMENTS=%%ARGUMENTS:%1=%% +if not (%1)==() ( + set ARGUMENTS=%* + call set ARGUMENTS=%%ARGUMENTS:%1=%% +) :: Read Python related variables from BuildDepsCache.txt for /f "delims== tokens=1,2" %%G in (BuildDepsCache-%TARGET_ARCH%.txt) do set %%G=%%H