make.bat: Preliminary Visual Studio 2019 support.
[blender.git] / build_files / windows / configure_msbuild.cmd
index 28d9950..c316e22 100644 (file)
@@ -1,3 +1,5 @@
+set BUILD_GENERATOR_POST=
+set BUILD_PLATFORM_SELECT=
 if "%BUILD_ARCH%"=="x64" (
        set MSBUILD_PLATFORM=x64
 ) else if "%BUILD_ARCH%"=="x86" (
@@ -23,7 +25,14 @@ if "%WITH_CLANG%"=="1" (
 if "%WITH_PYDEBUG%"=="1" (
        set PYDEBUG_CMAKE_ARGS=-DWINDOWS_PYTHON_DEBUG=On
 )
-set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Visual Studio %BUILD_VS_VER% %BUILD_VS_YEAR%%WINDOWS_ARCH%" %TESTS_CMAKE_ARGS% %CLANG_CMAKE_ARGS% %ASAN_CMAKE_ARGS% %PYDEBUG_CMAKE_ARGS%
+
+if "%BUILD_VS_YEAR%"=="2019" (
+       set BUILD_PLATFORM_SELECT=-A %MSBUILD_PLATFORM%
+) else (
+       set BUILD_GENERATOR_POST=%WINDOWS_ARCH%
+)
+
+set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Visual Studio %BUILD_VS_VER% %BUILD_VS_YEAR%%BUILD_GENERATOR_POST%" %BUILD_PLATFORM_SELECT% %TESTS_CMAKE_ARGS% %CLANG_CMAKE_ARGS% %ASAN_CMAKE_ARGS% %PYDEBUG_CMAKE_ARGS%
 
 if NOT EXIST %BUILD_DIR%\nul (
        mkdir %BUILD_DIR%
@@ -52,8 +61,8 @@ if "%MUST_CONFIGURE%"=="1" (
                %BUILD_CMAKE_ARGS% ^
                -H%BLENDER_DIR% ^
                -B%BUILD_DIR% 
-
-       if %ERRORLEVEL% NEQ 0 (
+       
+       if errorlevel 1 (
                echo "Configuration Failed"
                exit /b 1
        )