layers: Change 'VS' to 'vertex shader'
[platform/upstream/Vulkan-LoaderAndValidationLayers.git] / build_windows_targets.bat
1 echo off
2 REM
3 REM This Windows batch file builds this repository for the following targets:
4 REM 64/32-bit Release/Debug
5 REM It uses CMake to genererate the project files and then invokes msbuild
6 REM to build them.
7 REM The update_external_sources.bat batch file must be executed before running
8 REM this batch file
9 REM
10 REM Arguments:
11 REM None: Runs CMake and builds all 4 combinations
12 REM Argument contains:
13 REM     cmake (case insensitive): Deletes build and build32 and runs just CMake on both
14 REM     32: Deletes build32, runs CMake and builds 32-bit versions
15 REM     64: Deletes build, runs CMake and builds 64-bit versions
16 REM Example:
17 REM build_windows_targets.bat 64
18 REM deletes build, creates build, runs CMake and compiles 64-bit Debug and Release.
19
20 set do_cmake=0
21 set do_32=1
22 set do_64=1
23 if "%1"=="" goto no_args
24 set do_cmake=0
25 set do_32=0
26 set do_64=0
27 for %%a in (%*) do (
28     echo.%%a | %WINDIR%\system32\find.exe /I "cmake">Nul && (set do_cmake=1)
29     echo.%%a | %WINDIR%\system32\find.exe "32">Nul && (set do_32=1)
30     echo.%%a | %WINDIR%\system32\find.exe "64">Nul && (set do_64=1)
31 )
32 :no_args
33 if %do_cmake%==0 (
34     if %do_32%==0 (
35         if %do_64%==0 (
36             echo No valid parameters specified.
37             exit /b 1
38         )
39     )
40 )
41
42 REM Determine the appropriate CMake strings for the current version of Visual Studio
43 echo Determining VS version
44 python .\determine_vs_version.py > vsversion.tmp
45 set /p VS_VERSION=< vsversion.tmp
46 echo Detected Visual Studio Version as %VS_VERSION%
47 del /Q /F vsversion.tmp
48
49 if %do_cmake%==1 (
50     rmdir /Q /S build
51     rmdir /Q /S build32
52     mkdir build
53     pushd build
54     echo Generating 64-bit CMake files for Visual Studio %VS_VERSION%
55     cmake -G "Visual Studio %VS_VERSION% Win64" ..
56     popd
57     mkdir build32
58     pushd build32
59     echo Generating 32-bit CMake files for Visual Studio %VS_VERSION%
60     cmake -G "Visual Studio %VS_VERSION%" ..
61     popd
62 )
63
64 REM *******************************************
65 REM 64-bit build
66 REM *******************************************
67 if %do_64%==1 (
68     rmdir /Q /S build
69     mkdir build
70     pushd build
71     echo Generating 64-bit CMake files for Visual Studio %VS_VERSION%
72     cmake -G "Visual Studio %VS_VERSION% Win64" ..
73     echo Building 64-bit Debug 
74     msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Debug /maxcpucount /verbosity:quiet
75     if errorlevel 1 (
76        echo.
77        echo 64-bit Debug build failed!
78        popd
79        exit /b 1
80     )   
81    
82     echo Building 64-bit Release 
83     msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Release /maxcpucount /verbosity:quiet
84     if errorlevel 1 (
85        echo.
86        echo 64-bit Release build failed!
87        popd
88        exit /b 1
89     )   
90     popd
91 )
92  
93 REM *******************************************
94 REM 32-bit build
95 REM *******************************************
96   
97 if %do_32%==1 (
98     rmdir /Q /S build32
99     mkdir build32
100     pushd build32
101     echo Generating 32-bit CMake files for Visual Studio %VS_VERSION%
102     cmake -G "Visual Studio %VS_VERSION%" ..
103     echo Building 32-bit Debug 
104     msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Debug /maxcpucount /verbosity:quiet
105     if errorlevel 1 (
106        echo.
107        echo 32-bit Debug build failed!
108        popd
109        exit /b 1
110     )   
111        
112     echo Building 32-bit Release 
113     msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Release /maxcpucount /verbosity:quiet
114     if errorlevel 1 (
115        echo.
116        echo 32-bit Release build failed!
117        popd
118        exit /b 1
119     )   
120     popd
121 )
122 exit /b 0