@echo off
REM Script that will launch polyspace-configure on the current IAR EW project. 
REM first parameter : path to the project (.ewp)
REM second parameter : configuration of the project (Debug, Release...)
set PRODUCT=C:\Program Files\Polyspace\R2019b
set BUILD_COMMAND=C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.5\common\bin\IarBuild.exe
set OPTIONS_FILE=.\options.opts
set PROJECT_PATH=%1
set CONFIG=%2
REM The build command is:
REM C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.0\common\bin\IarBuild.exe "path\to\the_project.eww" -build Debug
echo( 
echo ***************************
echo * Working, please wait... *
echo ***************************
echo(
REM launch polyspace-configure on the build command
"%PRODUCT%\polyspace\bin\polyspace-configure.exe" -allow-overwrite -output-options-file "%OPTIONS_FILE%" "%BUILD_COMMAND%" %PROJECT_PATH% -build %CONFIG%
echo( 
echo ********
echo * Done *
echo ********
Exit /B 0