Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 1 | @echo off
|
Cody Northrop | e13dd83 | 2015-12-30 11:53:18 -0700 | [diff] [blame] | 2 | REM Update source for glslang, LunarGLASS, spirv-tools
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 3 |
|
| 4 | setlocal EnableDelayedExpansion
|
| 5 | set errorCode=0
|
| 6 | set BUILD_DIR=%~dp0
|
| 7 | set BASE_DIR=%BUILD_DIR%..
|
| 8 | set GLSLANG_DIR=%BASE_DIR%\glslang
|
| 9 | set LUNARGLASS_DIR=%BASE_DIR%\LunarGLASS
|
Cody Northrop | e13dd83 | 2015-12-30 11:53:18 -0700 | [diff] [blame] | 10 | set SPIRV_TOOLS_DIR=%BASE_DIR%\spirv-tools
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 11 |
|
| 12 | REM // ======== Parameter parsing ======== //
|
| 13 |
|
| 14 | if "%1" == "" (
|
| 15 | echo usage: update_external_sources.bat [options]
|
| 16 | echo.
|
| 17 | echo Available options:
|
| 18 | echo --sync-glslang just pull glslang_revision
|
| 19 | echo --sync-LunarGLASS just pull LunarGLASS_revision
|
Cody Northrop | e13dd83 | 2015-12-30 11:53:18 -0700 | [diff] [blame] | 20 | echo --sync-spirv-tools just pull spirv-tools_revision
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 21 | echo --build-glslang pulls glslang_revision, configures CMake, builds Release and Debug
|
| 22 | echo --build-LunarGLASS pulls LunarGLASS_revision, configures CMake, builds Release and Debug
|
Cody Northrop | e13dd83 | 2015-12-30 11:53:18 -0700 | [diff] [blame] | 23 | echo --build-spirv-tools pulls spirv-tools_revision, configures CMake, builds Release and Debug
|
| 24 | echo --all sync and build glslang, LunarGLASS, spirv-tools
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 25 | goto:finish
|
| 26 | )
|
| 27 |
|
| 28 | set sync-glslang=0
|
| 29 | set sync-LunarGLASS=0
|
Cody Northrop | e13dd83 | 2015-12-30 11:53:18 -0700 | [diff] [blame] | 30 | set sync-spirv-tools=0
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 31 | set build-glslang=0
|
| 32 | set build-LunarGLASS=0
|
Cody Northrop | e13dd83 | 2015-12-30 11:53:18 -0700 | [diff] [blame] | 33 | set build-spirv-tools=0
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 34 | set check-glslang-build-dependencies=0
|
Cody Northrop | a195136 | 2015-07-02 11:33:41 -0600 | [diff] [blame] | 35 | set check-LunarGLASS-fetch-dependencies=0
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 36 | set check-LunarGLASS-build-dependencies=0
|
| 37 |
|
| 38 | :parameterLoop
|
| 39 |
|
| 40 | if "%1"=="" goto:parameterContinue
|
| 41 |
|
| 42 | if "%1" == "--sync-glslang" (
|
| 43 | set sync-glslang=1
|
Cody Northrop | 50a8512 | 2015-10-13 10:30:27 -0600 | [diff] [blame] | 44 | shift
|
| 45 | goto:parameterLoop
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 46 | )
|
| 47 |
|
| 48 | if "%1" == "--sync-LunarGLASS" (
|
| 49 | set sync-LunarGLASS=1
|
Cody Northrop | a195136 | 2015-07-02 11:33:41 -0600 | [diff] [blame] | 50 | set check-LunarGLASS-fetch-dependencies=1
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 51 | shift
|
| 52 | goto:parameterLoop
|
| 53 | )
|
| 54 |
|
Cody Northrop | e13dd83 | 2015-12-30 11:53:18 -0700 | [diff] [blame] | 55 | if "%1" == "--sync-spirv-tools" (
|
| 56 | set sync-spirv-tools=1
|
| 57 | shift
|
| 58 | goto:parameterLoop
|
| 59 | )
|
| 60 |
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 61 | if "%1" == "--build-glslang" (
|
| 62 | set sync-glslang=1
|
| 63 | set check-glslang-build-dependencies=1
|
| 64 | set build-glslang=1
|
| 65 | shift
|
| 66 | goto:parameterLoop
|
| 67 | )
|
| 68 |
|
| 69 | if "%1" == "--build-LunarGLASS" (
|
| 70 | set sync-LunarGLASS=1
|
Cody Northrop | a195136 | 2015-07-02 11:33:41 -0600 | [diff] [blame] | 71 | set check-LunarGLASS-fetch-dependencies=1
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 72 | set check-LunarGLASS-build-dependencies=1
|
| 73 | set build-LunarGLASS=1
|
| 74 | shift
|
| 75 | goto:parameterLoop
|
| 76 | )
|
| 77 |
|
Cody Northrop | e13dd83 | 2015-12-30 11:53:18 -0700 | [diff] [blame] | 78 | if "%1" == "--build-spirv-tools" (
|
| 79 | set sync-spirv-tools=1
|
| 80 | REM glslang has the same needs as spirv-tools
|
| 81 | set check-glslang-build-dependencies=1
|
| 82 | set build-spirv-tools=1
|
| 83 | shift
|
| 84 | goto:parameterLoop
|
| 85 | )
|
| 86 |
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 87 | if "%1" == "--all" (
|
| 88 | set sync-glslang=1
|
| 89 | set sync-LunarGLASS=1
|
Cody Northrop | e13dd83 | 2015-12-30 11:53:18 -0700 | [diff] [blame] | 90 | set sync-spirv-tools=1
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 91 | set build-glslang=1
|
| 92 | set build-LunarGLASS=1
|
Cody Northrop | e13dd83 | 2015-12-30 11:53:18 -0700 | [diff] [blame] | 93 | set build-spirv-tools=1
|
Cody Northrop | a195136 | 2015-07-02 11:33:41 -0600 | [diff] [blame] | 94 | set check-LunarGLASS-fetch-dependencies=1
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 95 | set check-glslang-build-dependencies=1
|
| 96 | set check-LunarGLASS-build-dependencies=1
|
| 97 | shift
|
| 98 | goto:parameterLoop
|
| 99 | )
|
| 100 |
|
| 101 | echo Unrecognized options "%1"
|
| 102 | goto:error
|
| 103 |
|
| 104 | :parameterContinue
|
| 105 |
|
| 106 | REM // ======== end Parameter parsing ======== //
|
| 107 |
|
| 108 |
|
| 109 | REM // ======== Dependency checking ======== //
|
Cody Northrop | 50a8512 | 2015-10-13 10:30:27 -0600 | [diff] [blame] | 110 | REM git is required for all paths
|
Cody Northrop | a195136 | 2015-07-02 11:33:41 -0600 | [diff] [blame] | 111 | for %%X in (git.exe) do (set FOUND=%%~$PATH:X)
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 112 | if not defined FOUND (
|
| 113 | echo Dependency check failed:
|
Cody Northrop | a195136 | 2015-07-02 11:33:41 -0600 | [diff] [blame] | 114 | echo git.exe not found
|
Cody Northrop | 50a8512 | 2015-10-13 10:30:27 -0600 | [diff] [blame] | 115 | echo Git for Windows can be downloaded here: https://git-scm.com/download/win
|
Cody Northrop | a195136 | 2015-07-02 11:33:41 -0600 | [diff] [blame] | 116 | echo Install and ensure git.exe makes it into your PATH
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 117 | set errorCode=1
|
| 118 | )
|
| 119 |
|
Cody Northrop | a195136 | 2015-07-02 11:33:41 -0600 | [diff] [blame] | 120 | if %check-LunarGLASS-fetch-dependencies% equ 1 (
|
| 121 | for %%X in (svn.exe) do (set FOUND=%%~$PATH:X)
|
| 122 | if not defined FOUND (
|
| 123 | echo Dependency check failed:
|
| 124 | echo svn.exe not found
|
| 125 | echo Get Subversion for Windows here: http://sourceforge.net/projects/win32svn/
|
| 126 | echo Install and ensure svn.exe makes it into your PATH, default is "C:\Program Files (x86)\Subversion\bin"
|
| 127 | set errorCode=1
|
| 128 | )
|
| 129 |
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 130 | for %%X in (wget.exe) do (set FOUND=%%~$PATH:X)
|
| 131 | if not defined FOUND (
|
| 132 | echo Dependency check failed:
|
| 133 | echo wget.exe not found
|
| 134 | echo Get wget for Windows here: http://gnuwin32.sourceforge.net/packages/wget.htm
|
| 135 | echo Easiest to select "Complete package, except sources" link which will install and setup PATH
|
| 136 | echo Install and ensure each makes it into your PATH, default is "C:\Program Files (x86)\GnuWin32\bin"
|
| 137 | set errorCode=1
|
| 138 | )
|
| 139 |
|
| 140 | for %%X in (gzip.exe) do (set FOUND=%%~$PATH:X)
|
| 141 | if not defined FOUND (
|
| 142 | echo Dependency check failed:
|
| 143 | echo gzip.exe not found
|
| 144 | echo Get gzip for Windows here: http://gnuwin32.sourceforge.net/packages/gzip.htm
|
| 145 | echo Easiest to select "Complete package, except sources" link which will install and setup PATH
|
| 146 | echo Install and ensure each makes it into your PATH, default is "C:\Program Files (x86)\GnuWin32\bin"
|
| 147 | set errorCode=1
|
| 148 | )
|
| 149 |
|
| 150 | for %%X in (tar.exe) do (set FOUND=%%~$PATH:X)
|
| 151 | if not defined FOUND (
|
| 152 | echo Dependency check failed:
|
| 153 | echo tar.exe not found
|
| 154 | echo Get tar for Windows here: http://gnuwin32.sourceforge.net/packages/gtar.htm
|
| 155 | echo Easiest to select Binaries/Setup link which will install and setup PATH
|
| 156 | echo Install and ensure each makes it into your PATH, default is "C:\Program Files (x86)\GnuWin32\bin"
|
| 157 | set errorCode=1
|
| 158 | )
|
| 159 | )
|
| 160 |
|
| 161 | if %check-glslang-build-dependencies% equ 1 (
|
| 162 | for %%X in (cmake.exe) do (set FOUND=%%~$PATH:X)
|
| 163 | if not defined FOUND (
|
| 164 | echo Dependency check failed:
|
| 165 | echo cmake.exe not found
|
| 166 | echo Get CNake 2.8 for Windows here: http://www.cmake.org/cmake/resources/software.html
|
| 167 | echo Install and ensure each makes it into your PATH, default is "C:\Program Files (x86)\CMake\bin"
|
| 168 | set errorCode=1
|
| 169 | )
|
| 170 | )
|
| 171 |
|
| 172 | if %check-LunarGLASS-build-dependencies% equ 1 (
|
| 173 | for %%X in (python.exe) do (set FOUND=%%~$PATH:X)
|
| 174 | if not defined FOUND (
|
| 175 | echo Dependency check failed:
|
| 176 | echo python.exe not found
|
| 177 | echo Get python 2.7x for Windows here: http://www.python.org/download/releases/2.7.6/
|
| 178 | echo Install and ensure each makes it into your PATH, default is "C:\Python27"
|
| 179 | set errorCode=1
|
| 180 | )
|
| 181 |
|
| 182 | for %%X in (cmake.exe) do (set FOUND=%%~$PATH:X)
|
| 183 | if not defined FOUND (
|
| 184 | echo Dependency check failed:
|
| 185 | echo cmake.exe not found
|
| 186 | echo Get CNake 2.8 for Windows here: http://www.cmake.org/cmake/resources/software.html
|
| 187 | echo Install and ensure each makes it into your PATH, default is "C:\Program Files (x86)\CMake\bin"
|
| 188 | set errorCode=1
|
| 189 | )
|
| 190 | )
|
| 191 |
|
| 192 | REM goto:main
|
| 193 |
|
| 194 | REM // ======== end Dependency checking ======== //
|
| 195 |
|
| 196 | :main
|
| 197 |
|
| 198 | if %errorCode% neq 0 (goto:error)
|
| 199 |
|
| 200 | REM Read the target versions from external file, which is shared with Linux script
|
| 201 | if not exist LunarGLASS_revision (
|
| 202 | echo.
|
| 203 | echo Missing LunarGLASS_revision file! Place it next to this script with target version in it.
|
| 204 | set errorCode=1
|
| 205 | goto:error
|
| 206 | )
|
| 207 |
|
| 208 | if not exist glslang_revision (
|
| 209 | echo.
|
| 210 | echo Missing glslang_revision file! Place it next to this script with target version in it.
|
| 211 | set errorCode=1
|
| 212 | goto:error
|
| 213 | )
|
| 214 |
|
Cody Northrop | e13dd83 | 2015-12-30 11:53:18 -0700 | [diff] [blame] | 215 | if not exist spirv-tools_revision (
|
| 216 | echo.
|
| 217 | echo Missing spirv-tools_revision file! Place it next to this script with target version in it.
|
| 218 | set errorCode=1
|
| 219 | goto:error
|
| 220 | )
|
| 221 |
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 222 | set /p LUNARGLASS_REVISION= < LunarGLASS_revision
|
| 223 | set /p GLSLANG_REVISION= < glslang_revision
|
Cody Northrop | e13dd83 | 2015-12-30 11:53:18 -0700 | [diff] [blame] | 224 | set /p SPIRV_TOOLS_REVISION= < spirv-tools_revision
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 225 | echo LUNARGLASS_REVISION=%LUNARGLASS_REVISION%
|
| 226 | echo GLSLANG_REVISION=%GLSLANG_REVISION%
|
Cody Northrop | e13dd83 | 2015-12-30 11:53:18 -0700 | [diff] [blame] | 227 | echo SPIRV_TOOLS_REVISION=%SPIRV_TOOLS_REVISION%
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 228 |
|
GregF | 328d16c | 2015-09-23 11:16:44 -0600 | [diff] [blame] | 229 | set /p LUNARGLASS_REVISION_R32= < LunarGLASS_revision_R32
|
GregF | 328d16c | 2015-09-23 11:16:44 -0600 | [diff] [blame] | 230 | echo LUNARGLASS_REVISION_R32=%LUNARGLASS_REVISION_R32%
|
GregF | 328d16c | 2015-09-23 11:16:44 -0600 | [diff] [blame] | 231 |
|
Cody Northrop | e13dd83 | 2015-12-30 11:53:18 -0700 | [diff] [blame] | 232 | echo Creating and/or updating glslang, LunarGLASS, spirv-tools in %BASE_DIR%
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 233 |
|
| 234 | if %sync-glslang% equ 1 (
|
GregF | 328d16c | 2015-09-23 11:16:44 -0600 | [diff] [blame] | 235 | rd /S /Q %GLSLANG_DIR%
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 236 | if not exist %GLSLANG_DIR% (
|
| 237 | call:create_glslang
|
| 238 | )
|
| 239 | if %errorCode% neq 0 (goto:error)
|
| 240 | call:update_glslang
|
| 241 | if %errorCode% neq 0 (goto:error)
|
| 242 | )
|
| 243 |
|
| 244 | if %sync-LunarGLASS% equ 1 (
|
Cody Northrop | 50a8512 | 2015-10-13 10:30:27 -0600 | [diff] [blame] | 245 | rd /S /Q %LUNARGLASS_DIR%
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 246 | if not exist %LUNARGLASS_DIR% (
|
| 247 | call:create_LunarGLASS
|
| 248 | )
|
| 249 | if %errorCode% neq 0 (goto:error)
|
| 250 | call:update_LunarGLASS
|
| 251 | if %errorCode% neq 0 (goto:error)
|
| 252 | )
|
| 253 |
|
Cody Northrop | e13dd83 | 2015-12-30 11:53:18 -0700 | [diff] [blame] | 254 | if %sync-spirv-tools% equ 1 (
|
| 255 | rd /S /Q %SPIRV_TOOLS_DIR%
|
| 256 | if %errorlevel% neq 0 (goto:error)
|
| 257 | if not exist %SPIRV_TOOLS_DIR% (
|
| 258 | call:create_spirv-tools
|
| 259 | )
|
| 260 | if %errorCode% neq 0 (goto:error)
|
| 261 | call:update_spirv-tools
|
| 262 | if %errorCode% neq 0 (goto:error)
|
| 263 | )
|
| 264 |
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 265 | if %build-glslang% equ 1 (
|
| 266 | call:build_glslang
|
| 267 | if %errorCode% neq 0 (goto:error)
|
| 268 | )
|
| 269 |
|
| 270 | if %build-LunarGLASS% equ 1 (
|
| 271 | call:build_LunarGLASS
|
| 272 | if %errorCode% neq 0 (goto:error)
|
| 273 | )
|
| 274 |
|
Cody Northrop | e13dd83 | 2015-12-30 11:53:18 -0700 | [diff] [blame] | 275 | if %build-spirv-tools% equ 1 (
|
| 276 | call:build_spirv-tools
|
| 277 | if %errorCode% neq 0 (goto:error)
|
| 278 | )
|
| 279 |
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 280 | echo.
|
Cody Northrop | e13dd83 | 2015-12-30 11:53:18 -0700 | [diff] [blame] | 281 | echo Exiting
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 282 | goto:finish
|
| 283 |
|
| 284 | :error
|
| 285 | echo.
|
| 286 | echo Halting due to error
|
| 287 | goto:finish
|
| 288 |
|
| 289 | :finish
|
| 290 | if not "%cd%\" == "%BUILD_DIR%" ( cd %BUILD_DIR% )
|
| 291 | endlocal
|
| 292 | goto:eof
|
| 293 |
|
| 294 |
|
| 295 |
|
| 296 | REM // ======== Functions ======== //
|
| 297 |
|
| 298 | :create_glslang
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 299 | echo.
|
| 300 | echo Creating local glslang repository %GLSLANG_DIR%)
|
| 301 | mkdir %GLSLANG_DIR%
|
| 302 | cd %GLSLANG_DIR%
|
Greg Fischer | 36b5915 | 2015-10-02 13:05:27 -0600 | [diff] [blame] | 303 | git clone git@gitlab.khronos.org:GLSL/glslang.git .
|
Cody Northrop | a195136 | 2015-07-02 11:33:41 -0600 | [diff] [blame] | 304 | git checkout %GLSLANG_REVISION%
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 305 | if not exist %GLSLANG_DIR%\SPIRV (
|
| 306 | echo glslang source download failed!
|
| 307 | set errorCode=1
|
| 308 | )
|
| 309 | goto:eof
|
| 310 |
|
| 311 | :update_glslang
|
| 312 | echo.
|
| 313 | echo Updating %GLSLANG_DIR%
|
| 314 | cd %GLSLANG_DIR%
|
Greg Fischer | 124b68d | 2015-10-08 17:53:48 -0600 | [diff] [blame] | 315 | git fetch --all
|
Greg Fischer | 36b5915 | 2015-10-02 13:05:27 -0600 | [diff] [blame] | 316 | git checkout %GLSLANG_REVISION%
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 317 | goto:eof
|
| 318 |
|
| 319 | :create_LunarGLASS
|
| 320 | REM Windows complains if it can't find the directory below, no need to call
|
| 321 | REM rd /S /Q %LUNARGLASS_DIR%
|
| 322 | echo.
|
| 323 | echo Creating local LunarGLASS repository %LUNARGLASS_DIR%)
|
Cody Northrop | 50a8512 | 2015-10-13 10:30:27 -0600 | [diff] [blame] | 324 | mkdir %LUNARGLASS_DIR%
|
| 325 | cd %LUNARGLASS_DIR%
|
| 326 | git clone https://github.com/LunarG/LunarGLASS.git .
|
| 327 | git checkout %LUNARGLASS_REVISION%
|
| 328 | cd Core\LLVM
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 329 | echo.
|
| 330 | echo Downloading LLVM archive...
|
| 331 | wget http://llvm.org/releases/3.4/llvm-3.4.src.tar.gz
|
| 332 | REM tar on windows can't filter through gzip, so the below line doesn't work
|
| 333 | REM tar --gzip -xf llvm-3.4.src.tar.gz
|
| 334 | echo.
|
| 335 | echo Unzipping the archive...
|
| 336 | echo gzip --decompress --verbose --keep llvm-3.4.src.tar.gz
|
| 337 | gzip --decompress --verbose --keep llvm-3.4.src.tar.gz
|
| 338 | echo.
|
| 339 | echo Extracting the archive... (this is slow)
|
| 340 | echo tar -xf llvm-3.4.src.tar
|
| 341 | tar -xf llvm-3.4.src.tar
|
| 342 | if not exist %LUNARGLASS_DIR%\Core\LLVM\llvm-3.4\lib (
|
| 343 | echo .
|
| 344 | echo LLVM source download failed!
|
| 345 | echo Delete LunarGLASS directory and try again
|
| 346 | set errorCode=1
|
| 347 | goto:eof
|
| 348 | )
|
| 349 | echo.
|
| 350 | echo Syncing LunarGLASS source...
|
| 351 | cd %LUNARGLASS_DIR%
|
Cody Northrop | 50a8512 | 2015-10-13 10:30:27 -0600 | [diff] [blame] | 352 | REM put back the LunarGLASS github versions of some LLVM files
|
| 353 | git checkout -f .
|
| 354 | REM overwrite with private gitlab versions of some files
|
| 355 | svn checkout -r %LUNARGLASS_REVISION_R32% --force https://cvs.khronos.org/svn/repos/SPIRV/trunk/LunarGLASS/ .
|
| 356 | svn revert -R .
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 357 | if not exist %LUNARGLASS_DIR%\Frontends\SPIRV (
|
| 358 | echo.
|
| 359 | echo LunarGLASS source download failed!
|
| 360 | set errorCode=1
|
| 361 | )
|
| 362 | goto:eof
|
| 363 |
|
| 364 | :update_LunarGLASS
|
| 365 | echo.
|
| 366 | echo Updating %LUNARGLASS_DIR%
|
| 367 | cd %LUNARGLASS_DIR%
|
Cody Northrop | 50a8512 | 2015-10-13 10:30:27 -0600 | [diff] [blame] | 368 | git fetch --all
|
| 369 | git checkout -f %LUNARGLASS_REVISION% .
|
| 370 | if not exist %LUNARGLASS_DIR%\.svn (
|
| 371 | svn checkout -r %LUNARGLASS_REVISION_R32% --force https://cvs.khronos.org/svn/repos/SPIRV/trunk/LunarGLASS/ .
|
| 372 | )
|
| 373 | svn update -r %LUNARGLASS_REVISION_R325
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 374 | svn revert -R .
|
| 375 | goto:eof
|
| 376 |
|
Cody Northrop | e13dd83 | 2015-12-30 11:53:18 -0700 | [diff] [blame] | 377 | :create_spirv-tools
|
| 378 | echo.
|
| 379 | echo Creating local spirv-tools repository %SPIRV_TOOLS_DIR%)
|
| 380 | mkdir %SPIRV_TOOLS_DIR%
|
| 381 | cd %SPIRV_TOOLS_DIR%
|
David Pinedo | cd58eb6 | 2016-01-07 11:12:23 -0700 | [diff] [blame] | 382 | git clone git@gitlab.khronos.org:spirv/spirv-tools.git . |
Cody Northrop | e13dd83 | 2015-12-30 11:53:18 -0700 | [diff] [blame] | 383 | git checkout %SPIRV_TOOLS_REVISION%
|
| 384 | if not exist %SPIRV_TOOLS_DIR%\source (
|
| 385 | echo spirv-tools source download failed!
|
| 386 | set errorCode=1
|
| 387 | )
|
| 388 | goto:eof
|
| 389 |
|
| 390 | :update_spirv-tools
|
| 391 | echo.
|
| 392 | echo Updating %SPIRV_TOOLS_DIR%
|
| 393 | cd %SPIRV_TOOLS_DIR%
|
| 394 | git fetch --all
|
| 395 | git checkout %SPIRV_TOOLS_REVISION%
|
| 396 | goto:eof
|
| 397 |
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 398 | :build_glslang
|
| 399 | echo.
|
| 400 | echo Building %GLSLANG_DIR%
|
| 401 | cd %GLSLANG_DIR%
|
| 402 | mkdir build
|
| 403 | set GLSLANG_BUILD_DIR=%GLSLANG_DIR%\build
|
| 404 | cd %GLSLANG_BUILD_DIR%
|
David Pinedo | cd58eb6 | 2016-01-07 11:12:23 -0700 | [diff] [blame] | 405 | cmake -G"Visual Studio 12 2013 Win64" -DCMAKE_INSTALL_PREFIX=install ..
|
| 406 | msbuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Debug
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 407 | REM Check for existence of one lib, even though we should check for all results
|
| 408 | if not exist %GLSLANG_BUILD_DIR%\glslang\Debug\glslang.lib (
|
| 409 | echo.
|
| 410 | echo glslang Debug build failed!
|
| 411 | set errorCode=1
|
| 412 | )
|
David Pinedo | cd58eb6 | 2016-01-07 11:12:23 -0700 | [diff] [blame] | 413 | msbuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Release
|
Cody Northrop | 50a8512 | 2015-10-13 10:30:27 -0600 | [diff] [blame] | 414 | REM Check for existence of one lib, even though we should check for all results
|
| 415 | if not exist %GLSLANG_BUILD_DIR%\glslang\Release\glslang.lib (
|
| 416 | echo.
|
| 417 | echo glslang Release build failed!
|
| 418 | set errorCode=1
|
| 419 | )
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 420 | goto:eof
|
| 421 |
|
| 422 | :build_LunarGLASS
|
| 423 | echo.
|
| 424 | echo Building %LUNARGLASS_DIR%
|
| 425 | set LLVM_DIR=%LUNARGLASS_DIR%\Core\LLVM\llvm-3.4
|
| 426 | cd %LLVM_DIR%
|
| 427 | mkdir build
|
| 428 | set LLVM_BUILD_DIR=%LLVM_DIR%\build
|
| 429 | cd %LLVM_BUILD_DIR%
|
David Pinedo | cd58eb6 | 2016-01-07 11:12:23 -0700 | [diff] [blame] | 430 | cmake -G"Visual Studio 12 2013 Win64" -DCMAKE_INSTALL_PREFIX=install ..
|
| 431 | msbuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Release
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 432 | REM Check for existence of one lib, even though we should check for all results
|
| 433 | if not exist %LLVM_BUILD_DIR%\lib\Release\LLVMCore.lib (
|
| 434 | echo.
|
| 435 | echo LLVM Release build failed!
|
| 436 | set errorCode=1
|
| 437 | goto:eof
|
| 438 | )
|
Cody Northrop | 50a8512 | 2015-10-13 10:30:27 -0600 | [diff] [blame] | 439 | REM disable Debug build of LLVM until LunarGLASS cmake files are updated to
|
| 440 | REM handle Debug and Release builds of glslang simultaneously, instead of
|
| 441 | REM whatever last lands in "./build/install"
|
David Pinedo | cd58eb6 | 2016-01-07 11:12:23 -0700 | [diff] [blame] | 442 | REM msbuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Debug
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 443 | REM Check for existence of one lib, even though we should check for all results
|
Cody Northrop | 50a8512 | 2015-10-13 10:30:27 -0600 | [diff] [blame] | 444 | REM if not exist %LLVM_BUILD_DIR%\lib\Debug\LLVMCore.lib (
|
| 445 | REM echo.
|
| 446 | REM echo LLVM Debug build failed!
|
| 447 | REM set errorCode=1
|
| 448 | REM goto:eof
|
| 449 | REM )
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 450 | cd %LUNARGLASS_DIR%
|
| 451 | mkdir build
|
| 452 | set LUNARGLASS_BUILD_DIR=%LUNARGLASS_DIR%\build
|
| 453 | cd %LUNARGLASS_BUILD_DIR%
|
David Pinedo | cd58eb6 | 2016-01-07 11:12:23 -0700 | [diff] [blame] | 454 | cmake -G"Visual Studio 12 2013 Win64" -DCMAKE_INSTALL_PREFIX=install ..
|
| 455 | msbuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Release
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 456 | REM Check for existence of one lib, even though we should check for all results
|
| 457 | if not exist %LUNARGLASS_BUILD_DIR%\Core\Release\core.lib (
|
| 458 | echo.
|
| 459 | echo LunarGLASS build failed!
|
| 460 | set errorCode=1
|
| 461 | goto:eof
|
| 462 | )
|
Cody Northrop | 50a8512 | 2015-10-13 10:30:27 -0600 | [diff] [blame] | 463 | REM disable Debug build of LunarGLASS until its cmake file can be updated to
|
| 464 | REM handle Debug and Release builds of glslang simultaneously, instead of
|
| 465 | REM whatever last lands in "./build/install"
|
David Pinedo | cd58eb6 | 2016-01-07 11:12:23 -0700 | [diff] [blame] | 466 | REM msbuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Debug
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 467 | REM Check for existence of one lib, even though we should check for all results
|
Cody Northrop | 50a8512 | 2015-10-13 10:30:27 -0600 | [diff] [blame] | 468 | REM if not exist %LUNARGLASS_BUILD_DIR%\Core\Debug\core.lib (
|
| 469 | REM echo.
|
| 470 | REM echo LunarGLASS build failed!
|
| 471 | REM set errorCode=1
|
| 472 | REM goto:eof
|
| 473 | REM )
|
Cody Northrop | a8ac135 | 2015-05-12 16:23:59 -0600 | [diff] [blame] | 474 | goto:eof
|
Cody Northrop | e13dd83 | 2015-12-30 11:53:18 -0700 | [diff] [blame] | 475 |
|
| 476 | :build_spirv-tools
|
| 477 | echo.
|
| 478 | echo Building %SPIRV_TOOLS_DIR%
|
| 479 | cd %SPIRV_TOOLS_DIR%
|
| 480 | mkdir build
|
| 481 | set SPIRV_TOOLS_BUILD_DIR=%SPIRV_TOOLS_DIR%\build
|
| 482 | cd %SPIRV_TOOLS_BUILD_DIR%
|
David Pinedo | cd58eb6 | 2016-01-07 11:12:23 -0700 | [diff] [blame] | 483 | cmake -G "Visual Studio 12 2013 Win64" ..
|
| 484 | msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Debug
|
Cody Northrop | e13dd83 | 2015-12-30 11:53:18 -0700 | [diff] [blame] | 485 | REM Check for existence of one lib, even though we should check for all results
|
| 486 | if not exist %SPIRV_TOOLS_BUILD_DIR%\Debug\SPIRV-Tools.lib (
|
| 487 | echo.
|
| 488 | echo spirv-tools Debug build failed!
|
| 489 | set errorCode=1
|
| 490 | )
|
David Pinedo | cd58eb6 | 2016-01-07 11:12:23 -0700 | [diff] [blame] | 491 | msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Release
|
Cody Northrop | e13dd83 | 2015-12-30 11:53:18 -0700 | [diff] [blame] | 492 | REM Check for existence of one lib, even though we should check for all results
|
| 493 | if not exist %SPIRV_TOOLS_BUILD_DIR%\Release\SPIRV-Tools.lib (
|
| 494 | echo.
|
| 495 | echo spirv-tools Release build failed!
|
| 496 | set errorCode=1
|
| 497 | )
|
| 498 | goto:eof
|