I'm trying to determine if option is define statement/option for the VC compiler (/DSOME_OPTION=1 e.g.). Here is the part of options handling loop, which return error "Unexpected at this time: =option.". I've used search substring solution from StackOverflow: Batch file: Find if substring is in string (not in a file)
setlocal enabledelayedexpansion
:loop
if not "%~1"=="" (
rem all defines
set "option=%~1"
if x%option:/D=%==x%option% (
set DEFINE_STR=%DEFINE_STR% %~1
echo "DEFINE_STR=%DEFINE_STR%"
pause
)
shift
goto :loop
)