@echo off\r
REM Update source for glslang, LunarGLASS, spirv-tools\r
\r
+REM Determine the appropriate CMake strings for the current version of Visual Studio\r
+echo Determining VS version\r
+python .\determine_vs_version.py > vsversion.tmp\r
+set /p VS_VERSION=< vsversion.tmp\r
+echo Detected Visual Studio Version as %VS_VERSION%\r
+\r
+REM from that information set the appropriate MSBUILD machine target as weell.\r
+echo Determining MSBUILD target\r
+set MSBUILD_MACHINE_TARGET=x64\r
+@setlocal\r
+@echo off\r
+echo.%VS_VERSION% | findstr /C:"Win32" 1>nul\r
+if errorlevel 1 (\r
+ echo.\r
+) ELSE (\r
+ set MSBUILD_MACHINE_TARGET=x86\r
+)\r
+endlocal\r
+echo Detected MSBuild target as %MSBUILD_MACHINE_TARGET%\r
+\r
+REM Cleanup the file we used to collect the VS version output since it's no longer needed.\r
+del /Q /F vsversion.tmp\r
+\r
setlocal EnableDelayedExpansion\r
set errorCode=0\r
set BUILD_DIR=%~dp0\r
echo Available options:\r
echo --sync-glslang just pull glslang_revision\r
echo --sync-LunarGLASS just pull LunarGLASS_revision\r
- echo --sync-spirv-tools just pull spirv-tools_revision\r
+ echo --sync-spirv-tools just pull spirv-tools_revision\r
echo --build-glslang pulls glslang_revision, configures CMake, builds Release and Debug\r
echo --build-LunarGLASS pulls LunarGLASS_revision, configures CMake, builds Release and Debug\r
echo --build-spirv-tools pulls spirv-tools_revision, configures CMake, builds Release and Debug\r
mkdir build\r
set GLSLANG_BUILD_DIR=%GLSLANG_DIR%\build\r
cd %GLSLANG_BUILD_DIR%\r
- cmake -G"Visual Studio 12 2013 Win64" -DCMAKE_INSTALL_PREFIX=install ..\r
- msbuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Debug\r
+ echo Generating Glslang CMake files for Visual Studio %VS_VERSION% -DCMAKE_INSTALL_PREFIX=install ..\r
+ cmake -G"Visual Studio %VS_VERSION%" -DCMAKE_INSTALL_PREFIX=install ..\r
+ echo Building Glslang: MSBuild INSTALL.vcxproj /p:Platform=%MSBUILD_MACHINE_TARGET% /p:Configuration=Debug\r
+ msbuild INSTALL.vcxproj /p:Platform=%MSBUILD_MACHINE_TARGET% /p:Configuration=Debug\r
REM Check for existence of one lib, even though we should check for all results\r
if not exist %GLSLANG_BUILD_DIR%\glslang\Debug\glslang.lib (\r
echo.\r
echo glslang Debug build failed!\r
set errorCode=1\r
)\r
- msbuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Release\r
+ echo Building Glslang: MSBuild INSTALL.vcxproj /p:Platform=%MSBUILD_MACHINE_TARGET% /p:Configuration=Release\r
+ msbuild INSTALL.vcxproj /p:Platform=%MSBUILD_MACHINE_TARGET% /p:Configuration=Release\r
REM Check for existence of one lib, even though we should check for all results\r
if not exist %GLSLANG_BUILD_DIR%\glslang\Release\glslang.lib (\r
echo.\r
mkdir build\r
set LLVM_BUILD_DIR=%LLVM_DIR%\build\r
cd %LLVM_BUILD_DIR%\r
- cmake -G"Visual Studio 12 2013 Win64" -DCMAKE_INSTALL_PREFIX=install ..\r
- msbuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Release\r
+ echo Generating LLVM CMake files for Visual Studio %VS_VERSION% -DCMAKE_INSTALL_PREFIX=install ..\r
+ cmake -G"Visual Studio %VS_VERSION%" -DCMAKE_INSTALL_PREFIX=install ..\r
+ echo Building LLVM: MSBuild INSTALL.vcxproj /p:Platform=%MSBUILD_MACHINE_TARGET% /p:Configuration=Release\r
+ msbuild INSTALL.vcxproj /p:Platform=%MSBUILD_MACHINE_TARGET% /p:Configuration=Release\r
REM Check for existence of one lib, even though we should check for all results\r
if not exist %LLVM_BUILD_DIR%\lib\Release\LLVMCore.lib (\r
echo.\r
REM disable Debug build of LLVM until LunarGLASS cmake files are updated to\r
REM handle Debug and Release builds of glslang simultaneously, instead of\r
REM whatever last lands in "./build/install"\r
- REM msbuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Debug\r
+ REM echo Building LLVM: MSBuild INSTALL.vcxproj /p:Platform=%MSBUILD_MACHINE_TARGET% /p:Configuration=Debug\r
+ REM msbuild INSTALL.vcxproj /p:Platform=%MSBUILD_MACHINE_TARGET% /p:Configuration=Debug\r
REM Check for existence of one lib, even though we should check for all results\r
REM if not exist %LLVM_BUILD_DIR%\lib\Debug\LLVMCore.lib (\r
REM echo.\r
mkdir build\r
set LUNARGLASS_BUILD_DIR=%LUNARGLASS_DIR%\build\r
cd %LUNARGLASS_BUILD_DIR%\r
- cmake -G"Visual Studio 12 2013 Win64" -DCMAKE_INSTALL_PREFIX=install ..\r
- msbuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Release\r
+ echo Generating LunarGlass CMake files for Visual Studio %VS_VERSION% -DCMAKE_INSTALL_PREFIX=install ..\r
+ cmake -G"Visual Studio %VS_VERSION%" -DCMAKE_INSTALL_PREFIX=install ..\r
+ echo Building LunarGlass: MSBuild INSTALL.vcxproj /p:Platform=%MSBUILD_MACHINE_TARGET% /p:Configuration=Release\r
+ msbuild INSTALL.vcxproj /p:Platform=%MSBUILD_MACHINE_TARGET% /p:Configuration=Release\r
REM Check for existence of one lib, even though we should check for all results\r
if not exist %LUNARGLASS_BUILD_DIR%\Core\Release\core.lib (\r
echo.\r
REM disable Debug build of LunarGLASS until its cmake file can be updated to\r
REM handle Debug and Release builds of glslang simultaneously, instead of\r
REM whatever last lands in "./build/install"\r
- REM msbuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Debug\r
+ REM echo Building LunarGlass: MSBuild INSTALL.vcxproj /p:Platform=%MSBUILD_MACHINE_TARGET% /p:Configuration=Debug\r
+ REM msbuild INSTALL.vcxproj /p:Platform=%MSBUILD_MACHINE_TARGET% /p:Configuration=Debug\r
REM Check for existence of one lib, even though we should check for all results\r
REM if not exist %LUNARGLASS_BUILD_DIR%\Core\Debug\core.lib (\r
REM echo.\r
mkdir build\r
set SPIRV_TOOLS_BUILD_DIR=%SPIRV_TOOLS_DIR%\build\r
cd %SPIRV_TOOLS_BUILD_DIR%\r
- cmake -G "Visual Studio 12 2013 Win64" ..\r
- msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Debug\r
+ echo Generating Spirv-tools CMake files for Visual Studio %VS_VERSION% ..\r
+ cmake -G "Visual Studio %VS_VERSION%" ..\r
+ echo Building Spirv-tools: MSBuild ALL_BUILD.vcxproj /p:Platform=%MSBUILD_MACHINE_TARGET% /p:Configuration=Debug\r
+ msbuild ALL_BUILD.vcxproj /p:Platform=%MSBUILD_MACHINE_TARGET% /p:Configuration=Debug\r
REM Check for existence of one lib, even though we should check for all results\r
if not exist %SPIRV_TOOLS_BUILD_DIR%\Debug\SPIRV-Tools.lib (\r
echo.\r
echo spirv-tools Debug build failed!\r
set errorCode=1\r
)\r
- msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Release\r
+ echo Building Spirv-tools: MSBuild ALL_BUILD.vcxproj /p:Platform=%MSBUILD_MACHINE_TARGET% /p:Configuration=Release\r
+ msbuild ALL_BUILD.vcxproj /p:Platform=%MSBUILD_MACHINE_TARGET% /p:Configuration=Release\r
REM Check for existence of one lib, even though we should check for all results\r
if not exist %SPIRV_TOOLS_BUILD_DIR%\Release\SPIRV-Tools.lib (\r
echo.\r