Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 1 | @echo off |
| 2 | REM Update source for glslang, spirv-tools |
| 3 | |
| 4 | REM Determine the appropriate CMake strings for the current version of Visual Studio |
| 5 | echo Determining VS version |
Mark Lobodzinski | 6cde2f0 | 2016-11-18 14:12:01 -0700 | [diff] [blame] | 6 | python .\scripts\determine_vs_version.py > vsversion.tmp |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 7 | set /p VS_VERSION=< vsversion.tmp |
| 8 | echo Detected Visual Studio Version as %VS_VERSION% |
| 9 | |
| 10 | REM Cleanup the file we used to collect the VS version output since it's no longer needed. |
| 11 | del /Q /F vsversion.tmp |
| 12 | |
| 13 | setlocal EnableDelayedExpansion |
| 14 | set errorCode=0 |
| 15 | set BUILD_DIR=%~dp0 |
Karl Schultz | ece1396 | 2016-09-27 18:38:02 -0600 | [diff] [blame] | 16 | set BASE_DIR="%BUILD_DIR%external" |
Mark Lobodzinski | 1e4da61 | 2016-11-18 13:20:36 -0700 | [diff] [blame] | 17 | set REVISION_DIR="%BUILD_DIR%external_revisions" |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 18 | set GLSLANG_DIR=%BASE_DIR%\glslang |
| 19 | set SPIRV_TOOLS_DIR=%BASE_DIR%\spirv-tools |
| 20 | |
| 21 | REM // ======== Parameter parsing ======== // |
| 22 | |
Jeff Juliano | 6c1422c | 2017-08-26 10:04:29 -0400 | [diff] [blame] | 23 | set arg-use-implicit-component-list=1 |
| 24 | set arg-do-glslang=0 |
| 25 | set arg-do-spirv-tools=0 |
| 26 | set arg-no-sync=0 |
| 27 | set arg-no-build=0 |
| 28 | |
| 29 | :parameterLoop |
| 30 | |
| 31 | if "%1"=="" goto:parameterContinue |
| 32 | |
| 33 | if "%1" == "--glslang" ( |
| 34 | set arg-do-glslang=1 |
| 35 | set arg-use-implicit-component-list=0 |
| 36 | echo Building glslang ^(%1^) |
| 37 | shift |
| 38 | goto:parameterLoop |
| 39 | ) |
| 40 | |
| 41 | if "%1" == "-g" ( |
| 42 | set arg-do-glslang=1 |
| 43 | set arg-use-implicit-component-list=0 |
| 44 | echo Building glslang ^(%1^) |
| 45 | shift |
| 46 | goto:parameterLoop |
| 47 | ) |
| 48 | |
| 49 | if "%1" == "--spirv-tools" ( |
| 50 | set arg-do-spirv-tools=1 |
| 51 | set arg-use-implicit-component-list=0 |
| 52 | echo Building spirv-tools ^(%1^) |
| 53 | shift |
| 54 | goto:parameterLoop |
| 55 | ) |
| 56 | |
| 57 | if "%1" == "-s" ( |
| 58 | set arg-do-spirv-tools=1 |
| 59 | set arg-use-implicit-component-list=0 |
| 60 | echo Building spirv-tools ^(%1^) |
| 61 | shift |
| 62 | goto:parameterLoop |
| 63 | ) |
| 64 | |
| 65 | if "%1" == "--all" ( |
| 66 | set arg-do-glslang=1 |
| 67 | set arg-do-spirv-tools=1 |
| 68 | set arg-use-implicit-component-list=0 |
| 69 | echo Building glslang, spirv-tools ^(%1^) |
| 70 | shift |
| 71 | goto:parameterLoop |
| 72 | ) |
| 73 | |
| 74 | if "%1" == "--no-sync" ( |
| 75 | set arg-no-sync=1 |
| 76 | echo Skipping sync ^(%1^) |
| 77 | shift |
| 78 | goto:parameterLoop |
| 79 | ) |
| 80 | |
| 81 | if "%1" == "--no-build" ( |
| 82 | set arg-no-build=1 |
| 83 | echo Skipping build ^(%1^) |
| 84 | shift |
| 85 | goto:parameterLoop |
| 86 | ) |
| 87 | |
| 88 | echo. |
| 89 | echo Unrecognized option "%1" |
| 90 | echo. |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 91 | echo usage: update_external_sources.bat [options] |
| 92 | echo. |
Jeff Juliano | 6c1422c | 2017-08-26 10:04:29 -0400 | [diff] [blame] | 93 | echo Available options: |
| 94 | echo -g ^| --glslang enable glslang component |
| 95 | echo -s ^| --spirv-tools enable spirv-tools component |
| 96 | echo --all enable all components |
| 97 | echo --no-sync skip sync from git |
| 98 | echo --no-build skip build |
| 99 | echo. |
Jeff Juliano | 3bedf34 | 2017-08-26 10:22:22 -0400 | [diff] [blame] | 100 | echo If any component enables are provided, only those components are enabled. |
| 101 | echo If no component enables are provided, all components are enabled. |
| 102 | echo. |
Jeff Juliano | 6c1422c | 2017-08-26 10:04:29 -0400 | [diff] [blame] | 103 | echo Sync uses git to pull a specific revision. |
| 104 | echo Build configures CMake, builds Release and Debug. |
| 105 | |
Jeff Juliano | 3bedf34 | 2017-08-26 10:22:22 -0400 | [diff] [blame] | 106 | |
Jeff Juliano | 6c1422c | 2017-08-26 10:04:29 -0400 | [diff] [blame] | 107 | goto:error |
| 108 | |
| 109 | :parameterContinue |
| 110 | |
| 111 | if %arg-use-implicit-component-list% equ 1 ( |
| 112 | echo Building glslang, spirv-tools |
| 113 | set arg-do-glslang=1 |
| 114 | set arg-do-spirv-tools=1 |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 115 | ) |
| 116 | |
| 117 | set sync-glslang=0 |
| 118 | set sync-spirv-tools=0 |
| 119 | set build-glslang=0 |
| 120 | set build-spirv-tools=0 |
| 121 | set check-glslang-build-dependencies=0 |
| 122 | |
Jeff Juliano | 6c1422c | 2017-08-26 10:04:29 -0400 | [diff] [blame] | 123 | if %arg-do-glslang% equ 1 ( |
| 124 | if %arg-no-sync% equ 0 ( |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 125 | set sync-glslang=1 |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 126 | ) |
Jeff Juliano | 6c1422c | 2017-08-26 10:04:29 -0400 | [diff] [blame] | 127 | if %arg-no-build% equ 0 ( |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 128 | set check-glslang-build-dependencies=1 |
| 129 | set build-glslang=1 |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 130 | ) |
Jeff Juliano | 6c1422c | 2017-08-26 10:04:29 -0400 | [diff] [blame] | 131 | ) |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 132 | |
Jeff Juliano | 6c1422c | 2017-08-26 10:04:29 -0400 | [diff] [blame] | 133 | if %arg-do-spirv-tools% equ 1 ( |
| 134 | if %arg-no-sync% equ 0 ( |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 135 | set sync-spirv-tools=1 |
Jeff Juliano | 6c1422c | 2017-08-26 10:04:29 -0400 | [diff] [blame] | 136 | ) |
| 137 | if %arg-no-build% equ 0 ( |
| 138 | REM glslang has the same dependencies as spirv-tools |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 139 | set check-glslang-build-dependencies=1 |
| 140 | set build-spirv-tools=1 |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 141 | ) |
Jeff Juliano | 6c1422c | 2017-08-26 10:04:29 -0400 | [diff] [blame] | 142 | ) |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 143 | |
Jeff Juliano | 6c1422c | 2017-08-26 10:04:29 -0400 | [diff] [blame] | 144 | REM this is a debugging aid that can be enabled while debugging command-line parsing |
| 145 | if 0 equ 1 ( |
| 146 | set arg |
| 147 | set sync-glslang |
| 148 | set sync-spirv-tools |
| 149 | set build-glslang |
| 150 | set build-spirv-tools |
| 151 | set check-glslang-build-dependencies |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 152 | goto:error |
Jeff Juliano | 6c1422c | 2017-08-26 10:04:29 -0400 | [diff] [blame] | 153 | ) |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 154 | |
| 155 | REM // ======== end Parameter parsing ======== // |
| 156 | |
| 157 | |
| 158 | REM // ======== Dependency checking ======== // |
| 159 | REM git is required for all paths |
| 160 | for %%X in (git.exe) do (set FOUND=%%~$PATH:X) |
| 161 | if not defined FOUND ( |
| 162 | echo Dependency check failed: |
| 163 | echo git.exe not found |
| 164 | echo Git for Windows can be downloaded here: https://git-scm.com/download/win |
| 165 | echo Install and ensure git.exe makes it into your PATH |
| 166 | set errorCode=1 |
| 167 | ) |
| 168 | |
| 169 | if %check-glslang-build-dependencies% equ 1 ( |
| 170 | for %%X in (cmake.exe) do (set FOUND=%%~$PATH:X) |
| 171 | if not defined FOUND ( |
| 172 | echo Dependency check failed: |
| 173 | echo cmake.exe not found |
Jeff Juliano | ede64a7 | 2017-08-26 08:20:51 -0400 | [diff] [blame] | 174 | echo Get CMake for Windows here: http://www.cmake.org/cmake/resources/software.html |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 175 | echo Install and ensure each makes it into your PATH, default is "C:\Program Files (x86)\CMake\bin" |
| 176 | set errorCode=1 |
| 177 | ) |
| 178 | ) |
| 179 | |
| 180 | |
| 181 | REM goto:main |
| 182 | |
| 183 | REM // ======== end Dependency checking ======== // |
| 184 | |
| 185 | :main |
| 186 | |
| 187 | if %errorCode% neq 0 (goto:error) |
| 188 | |
| 189 | REM Read the target versions from external file, which is shared with Linux script |
| 190 | |
Mike Weiblen | 2248925 | 2017-02-16 17:00:35 -0700 | [diff] [blame] | 191 | if not exist %REVISION_DIR%\glslang_giturl ( |
| 192 | echo. |
| 193 | echo Missing glslang_giturl file! Place it in %REVISION_DIR% with git repo URL in it. |
| 194 | set errorCode=1 |
| 195 | goto:error |
| 196 | ) |
| 197 | |
Mark Lobodzinski | 1e4da61 | 2016-11-18 13:20:36 -0700 | [diff] [blame] | 198 | if not exist %REVISION_DIR%\glslang_revision ( |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 199 | echo. |
Mike Weiblen | 2248925 | 2017-02-16 17:00:35 -0700 | [diff] [blame] | 200 | echo Missing glslang_revision file! Place it in %REVISION_DIR% with target version in it. |
| 201 | set errorCode=1 |
| 202 | goto:error |
| 203 | ) |
| 204 | |
| 205 | if not exist %REVISION_DIR%\spirv-tools_giturl ( |
| 206 | echo. |
| 207 | echo Missing spirv-tools_giturl file! Place it in %REVISION_DIR% with git repo URL in it. |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 208 | set errorCode=1 |
| 209 | goto:error |
| 210 | ) |
| 211 | |
Mark Lobodzinski | 1e4da61 | 2016-11-18 13:20:36 -0700 | [diff] [blame] | 212 | if not exist %REVISION_DIR%\spirv-tools_revision ( |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 213 | echo. |
Mark Lobodzinski | 1e4da61 | 2016-11-18 13:20:36 -0700 | [diff] [blame] | 214 | echo Missing spirv-tools_revision file! Place it in %REVISION_DIR% with target version in it. |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 215 | set errorCode=1 |
| 216 | goto:error |
| 217 | ) |
| 218 | |
Mike Weiblen | 2248925 | 2017-02-16 17:00:35 -0700 | [diff] [blame] | 219 | if not exist %REVISION_DIR%\spirv-headers_giturl ( |
| 220 | echo. |
| 221 | echo Missing spirv-headers_giturl file! Place it in %REVISION_DIR% with git repo URL in it. |
| 222 | set errorCode=1 |
| 223 | goto:error |
| 224 | ) |
| 225 | |
Mark Lobodzinski | 3942125 | 2016-11-18 13:48:44 -0700 | [diff] [blame] | 226 | if not exist %REVISION_DIR%\spirv-headers_revision ( |
| 227 | echo. |
| 228 | echo Missing spirv-headers_revision file! Place it in %REVISION_DIR% with target version in it. |
| 229 | set errorCode=1 |
| 230 | goto:error |
| 231 | ) |
| 232 | |
Mike Weiblen | 2248925 | 2017-02-16 17:00:35 -0700 | [diff] [blame] | 233 | set /p GLSLANG_GITURL= < %REVISION_DIR%\glslang_giturl |
Mark Lobodzinski | 1e4da61 | 2016-11-18 13:20:36 -0700 | [diff] [blame] | 234 | set /p GLSLANG_REVISION= < %REVISION_DIR%\glslang_revision |
Mike Weiblen | 2248925 | 2017-02-16 17:00:35 -0700 | [diff] [blame] | 235 | set /p SPIRV_TOOLS_GITURL= < %REVISION_DIR%\spirv-tools_giturl |
Mark Lobodzinski | 1e4da61 | 2016-11-18 13:20:36 -0700 | [diff] [blame] | 236 | set /p SPIRV_TOOLS_REVISION= < %REVISION_DIR%\spirv-tools_revision |
Mike Weiblen | 2248925 | 2017-02-16 17:00:35 -0700 | [diff] [blame] | 237 | set /p SPIRV_HEADERS_GITURL= < %REVISION_DIR%\spirv-headers_giturl |
Mark Lobodzinski | 1e4da61 | 2016-11-18 13:20:36 -0700 | [diff] [blame] | 238 | set /p SPIRV_HEADERS_REVISION= < %REVISION_DIR%\spirv-headers_revision |
Mike Weiblen | 2248925 | 2017-02-16 17:00:35 -0700 | [diff] [blame] | 239 | |
| 240 | echo GLSLANG_GITURL=%GLSLANG_GITURL% |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 241 | echo GLSLANG_REVISION=%GLSLANG_REVISION% |
Mike Weiblen | 2248925 | 2017-02-16 17:00:35 -0700 | [diff] [blame] | 242 | echo SPIRV_TOOLS_GITURL=%SPIRV_TOOLS_GITURL% |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 243 | echo SPIRV_TOOLS_REVISION=%SPIRV_TOOLS_REVISION% |
Mike Weiblen | 2248925 | 2017-02-16 17:00:35 -0700 | [diff] [blame] | 244 | echo SPIRV_HEADERS_GITURL=%SPIRV_HEADERS_GITURL% |
Mark Young | 1223837 | 2016-08-11 08:46:55 -0600 | [diff] [blame] | 245 | echo SPIRV_HEADERS_REVISION=%SPIRV_HEADERS_REVISION% |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 246 | |
| 247 | |
| 248 | echo Creating and/or updating glslang, spirv-tools in %BASE_DIR% |
| 249 | |
| 250 | if %sync-glslang% equ 1 ( |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 251 | if not exist %GLSLANG_DIR% ( |
| 252 | call:create_glslang |
| 253 | ) |
| 254 | if %errorCode% neq 0 (goto:error) |
| 255 | call:update_glslang |
| 256 | if %errorCode% neq 0 (goto:error) |
| 257 | ) |
| 258 | |
| 259 | if %sync-spirv-tools% equ 1 ( |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 260 | if %errorlevel% neq 0 (goto:error) |
| 261 | if not exist %SPIRV_TOOLS_DIR% ( |
| 262 | call:create_spirv-tools |
| 263 | ) |
| 264 | if %errorCode% neq 0 (goto:error) |
| 265 | call:update_spirv-tools |
| 266 | if %errorCode% neq 0 (goto:error) |
| 267 | ) |
| 268 | |
| 269 | if %build-glslang% equ 1 ( |
| 270 | call:build_glslang |
| 271 | if %errorCode% neq 0 (goto:error) |
| 272 | ) |
| 273 | |
| 274 | if %build-spirv-tools% equ 1 ( |
| 275 | call:build_spirv-tools |
| 276 | if %errorCode% neq 0 (goto:error) |
| 277 | ) |
| 278 | |
| 279 | echo. |
| 280 | echo Exiting |
| 281 | goto:finish |
| 282 | |
| 283 | :error |
| 284 | echo. |
| 285 | echo Halting due to error |
Tony Barbour | 62f40db | 2017-06-21 10:22:05 -0600 | [diff] [blame] | 286 | set errorCode=1 |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 287 | goto:finish |
| 288 | |
| 289 | :finish |
| 290 | if not "%cd%\" == "%BUILD_DIR%" ( cd %BUILD_DIR% ) |
Tony Barbour | 62f40db | 2017-06-21 10:22:05 -0600 | [diff] [blame] | 291 | exit /b %errorCode% |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 292 | |
| 293 | |
| 294 | REM // ======== Functions ======== // |
| 295 | |
| 296 | :create_glslang |
| 297 | echo. |
| 298 | echo Creating local glslang repository %GLSLANG_DIR%) |
| 299 | mkdir %GLSLANG_DIR% |
| 300 | cd %GLSLANG_DIR% |
Mike Weiblen | 2248925 | 2017-02-16 17:00:35 -0700 | [diff] [blame] | 301 | git clone %GLSLANG_GITURL% . |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 302 | git checkout %GLSLANG_REVISION% |
| 303 | if not exist %GLSLANG_DIR%\SPIRV ( |
| 304 | echo glslang source download failed! |
| 305 | set errorCode=1 |
| 306 | ) |
| 307 | goto:eof |
| 308 | |
| 309 | :update_glslang |
| 310 | echo. |
| 311 | echo Updating %GLSLANG_DIR% |
| 312 | cd %GLSLANG_DIR% |
| 313 | git fetch --all |
| 314 | git checkout %GLSLANG_REVISION% |
| 315 | goto:eof |
| 316 | |
| 317 | :create_spirv-tools |
| 318 | echo. |
| 319 | echo Creating local spirv-tools repository %SPIRV_TOOLS_DIR%) |
| 320 | mkdir %SPIRV_TOOLS_DIR% |
| 321 | cd %SPIRV_TOOLS_DIR% |
Mike Weiblen | 2248925 | 2017-02-16 17:00:35 -0700 | [diff] [blame] | 322 | git clone %SPIRV_TOOLS_GITURL% . |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 323 | git checkout %SPIRV_TOOLS_REVISION% |
| 324 | if not exist %SPIRV_TOOLS_DIR%\source ( |
| 325 | echo spirv-tools source download failed! |
| 326 | set errorCode=1 |
| 327 | ) |
Greg Fischer | 04d0a56 | 2016-06-17 12:19:46 -0600 | [diff] [blame] | 328 | mkdir %SPIRV_TOOLS_DIR%\external |
| 329 | mkdir %SPIRV_TOOLS_DIR%\external\spirv-headers |
| 330 | cd %SPIRV_TOOLS_DIR%\external\spirv-headers |
Mike Weiblen | 2248925 | 2017-02-16 17:00:35 -0700 | [diff] [blame] | 331 | git clone %SPIRV_HEADERS_GITURL% . |
Mark Young | 1223837 | 2016-08-11 08:46:55 -0600 | [diff] [blame] | 332 | git checkout %SPIRV_HEADERS_REVISION% |
Greg Fischer | 04d0a56 | 2016-06-17 12:19:46 -0600 | [diff] [blame] | 333 | if not exist %SPIRV_TOOLS_DIR%\external\spirv-headers\README.md ( |
| 334 | echo spirv-headers download failed! |
| 335 | set errorCode=1 |
| 336 | ) |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 337 | goto:eof |
Mark Young | 1ef2330 | 2016-01-13 13:47:16 -0700 | [diff] [blame] | 338 | |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 339 | :update_spirv-tools |
| 340 | echo. |
| 341 | echo Updating %SPIRV_TOOLS_DIR% |
| 342 | cd %SPIRV_TOOLS_DIR% |
| 343 | git fetch --all |
| 344 | git checkout %SPIRV_TOOLS_REVISION% |
Greg Fischer | 04d0a56 | 2016-06-17 12:19:46 -0600 | [diff] [blame] | 345 | cd %SPIRV_TOOLS_DIR%\external\spirv-headers |
| 346 | git fetch --all |
Mark Young | 1223837 | 2016-08-11 08:46:55 -0600 | [diff] [blame] | 347 | git checkout %SPIRV_HEADERS_REVISION% |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 348 | goto:eof |
Mark Young | c2f1021 | 2016-01-13 13:47:16 -0700 | [diff] [blame] | 349 | |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 350 | :build_glslang |
| 351 | echo. |
| 352 | echo Building %GLSLANG_DIR% |
| 353 | cd %GLSLANG_DIR% |
Lenny Komow | 3b62ce8 | 2016-11-29 14:24:39 -0700 | [diff] [blame] | 354 | |
| 355 | if not exist build32 ( |
| 356 | mkdir build32 |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 357 | ) |
Lenny Komow | 3b62ce8 | 2016-11-29 14:24:39 -0700 | [diff] [blame] | 358 | if not exist build ( |
| 359 | mkdir build |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 360 | ) |
| 361 | |
| 362 | echo Making 32-bit glslang |
| 363 | echo ************************* |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 364 | set GLSLANG_BUILD_DIR=%GLSLANG_DIR%\build32 |
| 365 | cd %GLSLANG_BUILD_DIR% |
| 366 | |
| 367 | echo Generating 32-bit Glslang CMake files for Visual Studio %VS_VERSION% -DCMAKE_INSTALL_PREFIX=install .. |
| 368 | cmake -G "Visual Studio %VS_VERSION%" -DCMAKE_INSTALL_PREFIX=install .. |
| 369 | |
| 370 | echo Building 32-bit Glslang: MSBuild INSTALL.vcxproj /p:Platform=x86 /p:Configuration=Debug |
| 371 | msbuild INSTALL.vcxproj /p:Platform=x86 /p:Configuration=Debug /verbosity:quiet |
| 372 | |
| 373 | REM Check for existence of one lib, even though we should check for all results |
Karl Schultz | 168a62b | 2016-07-18 09:40:37 -0600 | [diff] [blame] | 374 | if not exist %GLSLANG_BUILD_DIR%\glslang\Debug\glslangd.lib ( |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 375 | echo. |
| 376 | echo glslang 32-bit Debug build failed! |
| 377 | set errorCode=1 |
| 378 | ) |
| 379 | echo Building Glslang: MSBuild INSTALL.vcxproj /p:Platform=x86 /p:Configuration=Release |
| 380 | msbuild INSTALL.vcxproj /p:Platform=x86 /p:Configuration=Release /verbosity:quiet |
| 381 | |
| 382 | REM Check for existence of one lib, even though we should check for all results |
| 383 | if not exist %GLSLANG_BUILD_DIR%\glslang\Release\glslang.lib ( |
| 384 | echo. |
| 385 | echo glslang 32-bit Release build failed! |
| 386 | set errorCode=1 |
| 387 | ) |
| 388 | |
| 389 | cd .. |
| 390 | |
| 391 | echo Making 64-bit glslang |
| 392 | echo ************************* |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 393 | set GLSLANG_BUILD_DIR=%GLSLANG_DIR%\build |
| 394 | cd %GLSLANG_BUILD_DIR% |
| 395 | |
| 396 | echo Generating 64-bit Glslang CMake files for Visual Studio %VS_VERSION% -DCMAKE_INSTALL_PREFIX=install .. |
| 397 | cmake -G "Visual Studio %VS_VERSION% Win64" -DCMAKE_INSTALL_PREFIX=install .. |
| 398 | |
| 399 | echo Building 64-bit Glslang: MSBuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Debug |
| 400 | msbuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Debug /verbosity:quiet |
| 401 | |
| 402 | REM Check for existence of one lib, even though we should check for all results |
Karl Schultz | 168a62b | 2016-07-18 09:40:37 -0600 | [diff] [blame] | 403 | if not exist %GLSLANG_BUILD_DIR%\glslang\Debug\glslangd.lib ( |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 404 | echo. |
| 405 | echo glslang 64-bit Debug build failed! |
| 406 | set errorCode=1 |
| 407 | ) |
| 408 | echo Building Glslang: MSBuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Release |
| 409 | msbuild INSTALL.vcxproj /p:Platform=x64 /p:Configuration=Release /verbosity:quiet |
| 410 | |
| 411 | REM Check for existence of one lib, even though we should check for all results |
| 412 | if not exist %GLSLANG_BUILD_DIR%\glslang\Release\glslang.lib ( |
| 413 | echo. |
| 414 | echo glslang 64-bit Release build failed! |
| 415 | set errorCode=1 |
| 416 | ) |
| 417 | goto:eof |
| 418 | |
| 419 | :build_spirv-tools |
| 420 | echo. |
| 421 | echo Building %SPIRV_TOOLS_DIR% |
| 422 | cd %SPIRV_TOOLS_DIR% |
| 423 | |
| 424 | REM Cleanup any old directories lying around. |
Lenny Komow | 3b62ce8 | 2016-11-29 14:24:39 -0700 | [diff] [blame] | 425 | if not exist build32 ( |
| 426 | mkdir build32 |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 427 | ) |
Lenny Komow | 3b62ce8 | 2016-11-29 14:24:39 -0700 | [diff] [blame] | 428 | if not exist build ( |
| 429 | mkdir build |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 430 | ) |
| 431 | |
| 432 | echo Making 32-bit spirv-tools |
| 433 | echo ************************* |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 434 | set SPIRV_TOOLS_BUILD_DIR=%SPIRV_TOOLS_DIR%\build32 |
| 435 | |
| 436 | cd %SPIRV_TOOLS_BUILD_DIR% |
| 437 | |
| 438 | echo Generating 32-bit spirv-tools CMake files for Visual Studio %VS_VERSION% .. |
| 439 | cmake -G "Visual Studio %VS_VERSION%" .. |
| 440 | |
| 441 | echo Building 32-bit spirv-tools: MSBuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Debug |
| 442 | msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Debug /verbosity:quiet |
| 443 | |
| 444 | REM Check for existence of one lib, even though we should check for all results |
| 445 | if not exist %SPIRV_TOOLS_BUILD_DIR%\source\Debug\SPIRV-Tools.lib ( |
| 446 | echo. |
| 447 | echo spirv-tools 32-bit Debug build failed! |
| 448 | set errorCode=1 |
| 449 | ) |
| 450 | |
| 451 | echo Building 32-bit spirv-tools: MSBuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Release |
| 452 | msbuild ALL_BUILD.vcxproj /p:Platform=x86 /p:Configuration=Release /verbosity:quiet |
| 453 | |
| 454 | REM Check for existence of one lib, even though we should check for all results |
| 455 | if not exist %SPIRV_TOOLS_BUILD_DIR%\source\Release\SPIRV-Tools.lib ( |
| 456 | echo. |
| 457 | echo spirv-tools 32-bit Release build failed! |
| 458 | set errorCode=1 |
| 459 | ) |
| 460 | |
| 461 | cd .. |
| 462 | |
| 463 | echo Making 64-bit spirv-tools |
| 464 | echo ************************* |
Mark Lobodzinski | 0e39375 | 2016-05-04 09:19:54 -0600 | [diff] [blame] | 465 | set SPIRV_TOOLS_BUILD_DIR=%SPIRV_TOOLS_DIR%\build |
| 466 | cd %SPIRV_TOOLS_BUILD_DIR% |
| 467 | |
| 468 | echo Generating 64-bit spirv-tools CMake files for Visual Studio %VS_VERSION% .. |
| 469 | cmake -G "Visual Studio %VS_VERSION% Win64" .. |
| 470 | |
| 471 | echo Building 64-bit spirv-tools: MSBuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Debug |
| 472 | msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Debug /verbosity:quiet |
| 473 | |
| 474 | REM Check for existence of one lib, even though we should check for all results |
| 475 | if not exist %SPIRV_TOOLS_BUILD_DIR%\source\Debug\SPIRV-Tools.lib ( |
| 476 | echo. |
| 477 | echo spirv-tools 64-bit Debug build failed! |
| 478 | set errorCode=1 |
| 479 | ) |
| 480 | |
| 481 | echo Building 64-bit spirv-tools: MSBuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Release |
| 482 | msbuild ALL_BUILD.vcxproj /p:Platform=x64 /p:Configuration=Release /verbosity:quiet |
| 483 | |
| 484 | REM Check for existence of one lib, even though we should check for all results |
| 485 | if not exist %SPIRV_TOOLS_BUILD_DIR%\source\Release\SPIRV-Tools.lib ( |
| 486 | echo. |
| 487 | echo spirv-tools 64-bit Release build failed! |
| 488 | set errorCode=1 |
| 489 | ) |
| 490 | goto:eof |