diff options
Diffstat (limited to 'build_files')
-rw-r--r-- | build_files/cmake/platform/platform_win32.cmake | 5 | ||||
-rw-r--r-- | build_files/windows/autodetect_msvc.cmd | 3 | ||||
-rw-r--r-- | build_files/windows/check_libraries.cmd | 1 | ||||
-rw-r--r-- | build_files/windows/configure_msbuild.cmd | 15 | ||||
-rw-r--r-- | build_files/windows/detect_msvc2017.cmd | 75 | ||||
-rw-r--r-- | build_files/windows/detect_msvc2019.cmd | 3 | ||||
-rw-r--r-- | build_files/windows/detect_msvc_vswhere.cmd | 79 | ||||
-rw-r--r-- | build_files/windows/parse_arguments.cmd | 9 |
8 files changed, 111 insertions, 79 deletions
diff --git a/build_files/cmake/platform/platform_win32.cmake b/build_files/cmake/platform/platform_win32.cmake index 85974bc3788..2c5294d37ab 100644 --- a/build_files/cmake/platform/platform_win32.cmake +++ b/build_files/cmake/platform/platform_win32.cmake @@ -173,7 +173,10 @@ if(NOT DEFINED LIBDIR) set(LIBDIR_BASE "windows") endif() # Can be 1910..1912 - if(MSVC_VERSION GREATER 1909) + if(MSVC_VERSION GREATER 1919) + message(STATUS "Visual Studio 2019 detected.") + set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc14) + elseif(MSVC_VERSION GREATER 1909) message(STATUS "Visual Studio 2017 detected.") set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/${LIBDIR_BASE}_vc14) elseif(MSVC_VERSION EQUAL 1900) diff --git a/build_files/windows/autodetect_msvc.cmd b/build_files/windows/autodetect_msvc.cmd index 4dbe009a890..c2884bc1fcd 100644 --- a/build_files/windows/autodetect_msvc.cmd +++ b/build_files/windows/autodetect_msvc.cmd @@ -3,6 +3,9 @@ echo No explicit msvc version requested, autodetecting version. call "%~dp0\detect_msvc2017.cmd" if %ERRORLEVEL% EQU 0 goto DetectionComplete +call "%~dp0\detect_msvc2019.cmd" +if %ERRORLEVEL% EQU 0 goto DetectionComplete + call "%~dp0\detect_msvc2015.cmd" if %ERRORLEVEL% EQU 0 goto DetectionComplete diff --git a/build_files/windows/check_libraries.cmd b/build_files/windows/check_libraries.cmd index 506728a194f..8c5f7ec7e17 100644 --- a/build_files/windows/check_libraries.cmd +++ b/build_files/windows/check_libraries.cmd @@ -1,5 +1,6 @@ if "%BUILD_VS_YEAR%"=="2015" set BUILD_VS_LIBDIRPOST=vc14 if "%BUILD_VS_YEAR%"=="2017" set BUILD_VS_LIBDIRPOST=vc14 +if "%BUILD_VS_YEAR%"=="2019" set BUILD_VS_LIBDIRPOST=vc14 if "%BUILD_ARCH%"=="x64" ( set BUILD_VS_SVNDIR=win64_%BUILD_VS_LIBDIRPOST% diff --git a/build_files/windows/configure_msbuild.cmd b/build_files/windows/configure_msbuild.cmd index 28d9950cb11..c316e2286e5 100644 --- a/build_files/windows/configure_msbuild.cmd +++ b/build_files/windows/configure_msbuild.cmd @@ -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 ) diff --git a/build_files/windows/detect_msvc2017.cmd b/build_files/windows/detect_msvc2017.cmd index 029f98cbe1e..5f760275f78 100644 --- a/build_files/windows/detect_msvc2017.cmd +++ b/build_files/windows/detect_msvc2017.cmd @@ -1,76 +1,3 @@ -if NOT "%verbose%" == "" ( - echo Detecting msvc 2017 -) set BUILD_VS_VER=15 set BUILD_VS_YEAR=2017 -set ProgramFilesX86=%ProgramFiles(x86)% -if not exist "%ProgramFilesX86%" set ProgramFilesX86=%ProgramFiles% - -set vs_where=%ProgramFilesX86%\Microsoft Visual Studio\Installer\vswhere.exe -if not exist "%vs_where%" ( - if NOT "%verbose%" == "" ( - echo Visual Studio 2017 ^(15.2 or newer^) is not detected - ) - goto FAIL -) - -if NOT "%verbose%" == "" ( - echo "%vs_where%" -latest %VSWHERE_ARGS% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64` - ) - -for /f "usebackq tokens=1* delims=: " %%i in (`"%vs_where%" -latest %VSWHERE_ARGS% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64`) do ( - if /i "%%i"=="installationPath" set VS_InstallDir=%%j -) - -if "%VS_InstallDir%"=="" ( - if NOT "%verbose%" == "" ( - echo Visual Studio is detected but the "Desktop development with C++" workload has not been instlled - goto FAIL - ) -) - -set VCVARS=%VS_InstallDir%\VC\Auxiliary\Build\vcvarsall.bat -if exist "%VCVARS%" ( - call "%VCVARS%" %BUILD_ARCH% -) else ( - if NOT "%verbose%" == "" ( - echo "%VCVARS%" not found - ) - goto FAIL -) - -rem try msbuild -msbuild /version > NUL -if errorlevel 1 ( - if NOT "%verbose%" == "" ( - echo Visual Studio %BUILD_VS_YEAR% msbuild not found - ) - goto FAIL -) - -if NOT "%verbose%" == "" ( - echo Visual Studio %BUILD_VS_YEAR% msbuild found -) - -REM try the c++ compiler -cl 2> NUL 1>&2 -if errorlevel 1 ( - if NOT "%verbose%" == "" ( - echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler not found - ) - goto FAIL -) - -if NOT "%verbose%" == "" ( - echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler found -) - -if NOT "%verbose%" == "" ( - echo Visual Studio 2017 is detected successfully -) -goto EOF - -:FAIL -exit /b 1 - -:EOF +call "%~dp0\detect_msvc_vswhere.cmd" diff --git a/build_files/windows/detect_msvc2019.cmd b/build_files/windows/detect_msvc2019.cmd new file mode 100644 index 00000000000..d75d6bae0d9 --- /dev/null +++ b/build_files/windows/detect_msvc2019.cmd @@ -0,0 +1,3 @@ +set BUILD_VS_VER=16 +set BUILD_VS_YEAR=2019 +call "%~dp0\detect_msvc_vswhere.cmd" diff --git a/build_files/windows/detect_msvc_vswhere.cmd b/build_files/windows/detect_msvc_vswhere.cmd new file mode 100644 index 00000000000..a538e506b39 --- /dev/null +++ b/build_files/windows/detect_msvc_vswhere.cmd @@ -0,0 +1,79 @@ +if NOT "%verbose%" == "" ( + echo Detecting msvc %BUILD_VS_YEAR% +) + +set ProgramFilesX86=%ProgramFiles(x86)% +if not exist "%ProgramFilesX86%" set ProgramFilesX86=%ProgramFiles% + +set vs_where=%ProgramFilesX86%\Microsoft Visual Studio\Installer\vswhere.exe +if not exist "%vs_where%" ( + if NOT "%verbose%" == "" ( + echo Visual Studio %BUILD_VS_YEAR% is not detected + ) + goto FAIL +) + +if NOT "%verbose%" == "" ( + echo "%vs_where%" -latest %VSWHERE_ARGS% -version ^[%BUILD_VS_VER%.0^,%BUILD_VS_VER%.99^) -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 + ) + +for /f "usebackq tokens=1* delims=: " %%i in (`"%vs_where%" -latest -version ^[%BUILD_VS_VER%.0^,%BUILD_VS_VER%.99^) %VSWHERE_ARGS% -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64`) do ( + if /i "%%i"=="installationPath" set VS_InstallDir=%%j +) + +if NOT "%verbose%" == "" ( + echo VS_Installdir="%VS_InstallDir%" +) + +if "%VS_InstallDir%"=="" ( + if NOT "%verbose%" == "" ( + echo Visual Studio is detected but the "Desktop development with C++" workload has not been instlled + goto FAIL + ) +) + +set VCVARS=%VS_InstallDir%\VC\Auxiliary\Build\vcvarsall.bat +if exist "%VCVARS%" ( + call "%VCVARS%" %BUILD_ARCH% +) else ( + if NOT "%verbose%" == "" ( + echo "%VCVARS%" not found + ) + goto FAIL +) + +rem try msbuild +msbuild /version > NUL +if errorlevel 1 ( + if NOT "%verbose%" == "" ( + echo Visual Studio %BUILD_VS_YEAR% msbuild not found + ) + goto FAIL +) + +if NOT "%verbose%" == "" ( + echo Visual Studio %BUILD_VS_YEAR% msbuild found +) + +REM try the c++ compiler +cl 2> NUL 1>&2 +if errorlevel 1 ( + if NOT "%verbose%" == "" ( + echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler not found + ) + goto FAIL +) + +if NOT "%verbose%" == "" ( + echo Visual Studio %BUILD_VS_YEAR% C/C++ Compiler found +) + +if NOT "%verbose%" == "" ( + echo Visual Studio %BUILD_VS_YEAR% is detected successfully +) +goto EOF + +:FAIL +exit /b 1 + +:EOF diff --git a/build_files/windows/parse_arguments.cmd b/build_files/windows/parse_arguments.cmd index 30bd2ebdcd2..c76efd49802 100644 --- a/build_files/windows/parse_arguments.cmd +++ b/build_files/windows/parse_arguments.cmd @@ -53,10 +53,17 @@ if NOT "%1" == "" ( ) else if "%1" == "2017pre" ( set BUILD_VS_YEAR=2017 set VSWHERE_ARGS=-prerelease - set BUILD_VS_YEAR=2017 ) else if "%1" == "2017b" ( set BUILD_VS_YEAR=2017 set VSWHERE_ARGS=-products Microsoft.VisualStudio.Product.BuildTools + ) else if "%1" == "2019" ( + set BUILD_VS_YEAR=2019 + ) else if "%1" == "2019pre" ( + set BUILD_VS_YEAR=2019 + set VSWHERE_ARGS=-prerelease + ) else if "%1" == "2019b" ( + set BUILD_VS_YEAR=2019 + set VSWHERE_ARGS=-products Microsoft.VisualStudio.Product.BuildTools ) else if "%1" == "2015" ( set BUILD_VS_YEAR=2015 ) else if "%1" == "packagename" ( |