echo on
set DISTUTILS_USE_SDK=1
set MSSdk=1
set "PY_VCRUNTIME_REDIST=%LIBRARY_BIN%\vcruntime140.dll"
set "MKL=%LIBRARY_PREFIX%"
set "CFLAGS=/GX /EHsc %CFLAGS%"

rem Disable building with pythran for now
set SCIPY_USE_PYTHRAN=0

%PYTHON% setup.py config_cc --compiler=intelemw config_fc --fcompiler=intelvem build --force install --old-and-unmanageable
if errorlevel 1 exit 1

rem Build wheel package
if NOT "%WHEELS_OUTPUT_FOLDER%"=="" (
    %PYTHON% setup.py config_cc --compiler=intelemw config_fc --fcompiler=intelvem bdist_wheel
    if errorlevel 1 exit 1

    copy dist\scipy*.whl %WHEELS_OUTPUT_FOLDER%
    if errorlevel 1 exit 1
)
