Mark Young | 1aacfe1 | 2016-01-28 14:39:19 -0700 | [diff] [blame] | 1 | echo off |
| 2 | REM |
| 3 | REM This batch file builds both 32-bit and 64-bit versions of the loader. |
| 4 | REM It is assumed that the developer has run the update_external_sources.bat |
| 5 | REM file prior to running this. |
| 6 | REM |
| 7 | |
| 8 | REM Determine the appropriate CMake strings for the current version of Visual Studio |
| 9 | echo Determining VS version |
| 10 | python .\determine_vs_version.py > vsversion.tmp |
| 11 | set /p VS_VERSION=< vsversion.tmp |
| 12 | echo Detected Visual Studio Version as %VS_VERSION% |
| 13 | |
| 14 | REM Cleanup the file we used to collect the VS version output since it's no longer needed. |
| 15 | del /Q /F vsversion.tmp |
| 16 | |
| 17 | rmdir /Q /S build |
| 18 | rmdir /Q /S build32 |
| 19 | |
| 20 | REM ******************************************* |
Jon Ashburn | 49ba27b | 2016-01-31 10:22:36 -0700 | [diff] [blame] | 21 | REM 64-bit LoaderAndTools build |
Mark Young | 1aacfe1 | 2016-01-28 14:39:19 -0700 | [diff] [blame] | 22 | REM ******************************************* |
| 23 | mkdir build |
| 24 | pushd build |
| 25 | |
| 26 | echo Generating 64-bit spirv-tools CMake files for Visual Studio %VS_VERSION% |
| 27 | cmake -G "Visual Studio %VS_VERSION% Win64" .. |
| 28 | |
Jon Ashburn | 49ba27b | 2016-01-31 10:22:36 -0700 | [diff] [blame] | 29 | echo Building 64-bit Debug LoaderAndTools |
Mark Young | 3f3b24a | 2016-02-01 14:51:13 -0700 | [diff] [blame] | 30 | msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Debug /verbosity:quiet |
Mark Young | 1aacfe1 | 2016-01-28 14:39:19 -0700 | [diff] [blame] | 31 | |
| 32 | REM Check for existence of one DLL, even though we should check for all results |
| 33 | if not exist .\loader\Debug\vulkan-1.dll ( |
| 34 | echo. |
Jon Ashburn | 49ba27b | 2016-01-31 10:22:36 -0700 | [diff] [blame] | 35 | echo LoaderAndTools 64-bit Debug build failed! |
Mark Young | 1aacfe1 | 2016-01-28 14:39:19 -0700 | [diff] [blame] | 36 | set errorCode=1 |
| 37 | ) |
| 38 | |
Jon Ashburn | 49ba27b | 2016-01-31 10:22:36 -0700 | [diff] [blame] | 39 | echo Building 64-bit Release LoaderAndTools |
Mark Young | 3f3b24a | 2016-02-01 14:51:13 -0700 | [diff] [blame] | 40 | msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Release /verbosity:quiet |
Mark Young | 1aacfe1 | 2016-01-28 14:39:19 -0700 | [diff] [blame] | 41 | |
| 42 | REM Check for existence of one DLL, even though we should check for all results |
| 43 | if not exist .\loader\Release\vulkan-1.dll ( |
| 44 | echo. |
Jon Ashburn | 49ba27b | 2016-01-31 10:22:36 -0700 | [diff] [blame] | 45 | echo LoaderAndTools 64-bit Release build failed! |
Mark Young | 1aacfe1 | 2016-01-28 14:39:19 -0700 | [diff] [blame] | 46 | set errorCode=1 |
| 47 | ) |
| 48 | |
| 49 | popd |
| 50 | |
| 51 | REM ******************************************* |
Jon Ashburn | 49ba27b | 2016-01-31 10:22:36 -0700 | [diff] [blame] | 52 | REM 32-bit LoaderAndTools build |
Mark Young | 1aacfe1 | 2016-01-28 14:39:19 -0700 | [diff] [blame] | 53 | REM ******************************************* |
| 54 | mkdir build32 |
| 55 | pushd build32 |
| 56 | |
Jon Ashburn | 49ba27b | 2016-01-31 10:22:36 -0700 | [diff] [blame] | 57 | echo Generating 32-bit LoaderAndTools CMake files for Visual Studio %VS_VERSION% |
Mark Young | 1aacfe1 | 2016-01-28 14:39:19 -0700 | [diff] [blame] | 58 | cmake -G "Visual Studio %VS_VERSION%" .. |
| 59 | |
Jon Ashburn | 49ba27b | 2016-01-31 10:22:36 -0700 | [diff] [blame] | 60 | echo Building 32-bit Debug LoaderAndTools |
Mark Young | 3f3b24a | 2016-02-01 14:51:13 -0700 | [diff] [blame] | 61 | msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Debug /verbosity:quiet |
Mark Young | 1aacfe1 | 2016-01-28 14:39:19 -0700 | [diff] [blame] | 62 | |
| 63 | REM Check for existence of one DLL, even though we should check for all results |
| 64 | if not exist .\loader\Debug\vulkan-1.dll ( |
| 65 | echo. |
Jon Ashburn | 49ba27b | 2016-01-31 10:22:36 -0700 | [diff] [blame] | 66 | echo LoaderAndTools 32-bit Debug build failed! |
Mark Young | 1aacfe1 | 2016-01-28 14:39:19 -0700 | [diff] [blame] | 67 | set errorCode=1 |
| 68 | ) |
| 69 | |
Jon Ashburn | 49ba27b | 2016-01-31 10:22:36 -0700 | [diff] [blame] | 70 | echo Building 32-bit Release LoaderAndTools |
Mark Young | 3f3b24a | 2016-02-01 14:51:13 -0700 | [diff] [blame] | 71 | msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Release /verbosity:quiet |
Mark Young | 1aacfe1 | 2016-01-28 14:39:19 -0700 | [diff] [blame] | 72 | |
| 73 | REM Check for existence of one DLL, even though we should check for all results |
| 74 | if not exist .\loader\Release\vulkan-1.dll ( |
| 75 | echo. |
Jon Ashburn | 49ba27b | 2016-01-31 10:22:36 -0700 | [diff] [blame] | 76 | echo LoaderAndTools 32-bit Release build failed! |
Mark Young | 1aacfe1 | 2016-01-28 14:39:19 -0700 | [diff] [blame] | 77 | set errorCode=1 |
| 78 | ) |
| 79 | |
| 80 | popd |
| 81 | |