diff options
| author | Jeff Juliano <jjuliano@nvidia.com> | 2017-08-26 10:04:29 -0400 |
|---|---|---|
| committer | Mark Lobodzinski <mark@lunarg.com> | 2017-08-28 14:34:47 -0600 |
| commit | 84f34f41a306e3d2c8f8e25770dfc9a951a41322 (patch) | |
| tree | a0fe197fcd5a75e72d48a16c9a6d1630345a8a1b | |
| parent | 1fef337c968e153c157577ca5f99bf3f83841249 (diff) | |
| download | usermoji-84f34f41a306e3d2c8f8e25770dfc9a951a41322.tar.xz | |
build: Add no-sync to update_ext_srcs batch file
Complete support for cygwin environment by adding --no-sync support
to update_external_sources.bat. Also change command line parsing for
the the .bat script to be similar to the .sh script.
Change-Id: Ie813938654e7f4bb9575eef2587f36ca2933f30c
| -rw-r--r-- | BUILD.md | 13 | ||||
| -rw-r--r-- | update_external_sources.bat | 134 |
2 files changed, 107 insertions, 40 deletions
@@ -212,7 +212,7 @@ for the Properties->Details tab of the loader vulkan-1.dll file that is built. Build all Windows targets after installing required software and cloning the Loader and Validation Layer repo as described above by completing the following steps in a "Developer Command Prompt for VS2013" window (Note that the update\_external\_sources script used below builds external tools into predefined locations. See **Loader and Validation Layer Dependencies** for more information and other options): ``` cd Vulkan-LoaderAndValidationLayers # cd to the root of the cloned git repository -update_external_sources.bat --all +update_external_sources.bat build_windows_targets.bat ``` @@ -225,14 +225,19 @@ This is described in a `LoaderAndLayerInterface` document in the `loader` folder This specification describes both how ICDs and layers should be properly packaged, and how developers can point to ICDs and layers within their builds. -### Cygwin +### Using Cygwin Git -If you are using Cygwin git instead of win32-native git, you can use Cygwin's git to sync external sources: +If you are using Cygwin git instead of win32-native git, you can use the *sh* script to sync using Cygwin's git (but not also build), then use the *bat* script to build (but not also sync). + +In a cygwin shell do this: ``` ./update_external_sources.sh --no-build ``` -Unfortunately, "update\_external\_sources.bat" does not have a --no-sync option. To build the external sources you have to modify "update\_external\_sources.bat" to skip the sync portions of the script. +Then in a Visual Studio Developer Command Prompt shell do this: +``` +update_external_sources.bat --no-sync +``` ## Android Build Install the required tools for Linux and Windows covered above, then add the following. diff --git a/update_external_sources.bat b/update_external_sources.bat index c0b41a2b..739ce53e 100644 --- a/update_external_sources.bat +++ b/update_external_sources.bat @@ -20,72 +20,134 @@ set SPIRV_TOOLS_DIR=%BASE_DIR%\spirv-tools REM // ======== Parameter parsing ======== // - if "%1" == "" ( - echo usage: update_external_sources.bat [options] - echo. - echo Available options: - echo --sync-glslang just pull glslang_revision - echo --sync-spirv-tools just pull spirv-tools_revision - echo --build-glslang pulls glslang_revision, configures CMake, builds Release and Debug - echo --build-spirv-tools pulls spirv-tools_revision, configures CMake, builds Release and Debug - echo --all sync and build glslang, spirv-tools - goto:finish - ) - - set sync-glslang=0 - set sync-spirv-tools=0 - set build-glslang=0 - set build-spirv-tools=0 - set check-glslang-build-dependencies=0 + set arg-use-implicit-component-list=1 + set arg-do-glslang=0 + set arg-do-spirv-tools=0 + set arg-no-sync=0 + set arg-no-build=0 :parameterLoop if "%1"=="" goto:parameterContinue - if "%1" == "--sync-glslang" ( - set sync-glslang=1 + if "%1" == "--glslang" ( + set arg-do-glslang=1 + set arg-use-implicit-component-list=0 + echo Building glslang ^(%1^) shift goto:parameterLoop ) - if "%1" == "--sync-spirv-tools" ( - set sync-spirv-tools=1 + if "%1" == "-g" ( + set arg-do-glslang=1 + set arg-use-implicit-component-list=0 + echo Building glslang ^(%1^) shift goto:parameterLoop ) - if "%1" == "--build-glslang" ( - set sync-glslang=1 - set check-glslang-build-dependencies=1 - set build-glslang=1 + if "%1" == "--spirv-tools" ( + set arg-do-spirv-tools=1 + set arg-use-implicit-component-list=0 + echo Building spirv-tools ^(%1^) shift goto:parameterLoop ) - if "%1" == "--build-spirv-tools" ( - set sync-spirv-tools=1 - REM glslang has the same needs as spirv-tools - set check-glslang-build-dependencies=1 - set build-spirv-tools=1 + if "%1" == "-s" ( + set arg-do-spirv-tools=1 + set arg-use-implicit-component-list=0 + echo Building spirv-tools ^(%1^) shift goto:parameterLoop ) if "%1" == "--all" ( - set sync-glslang=1 - set sync-spirv-tools=1 - set build-glslang=1 - set build-spirv-tools=1 - set check-glslang-build-dependencies=1 + set arg-do-glslang=1 + set arg-do-spirv-tools=1 + set arg-use-implicit-component-list=0 + echo Building glslang, spirv-tools ^(%1^) shift goto:parameterLoop ) - echo Unrecognized options "%1" + if "%1" == "--no-sync" ( + set arg-no-sync=1 + echo Skipping sync ^(%1^) + shift + goto:parameterLoop + ) + + if "%1" == "--no-build" ( + set arg-no-build=1 + echo Skipping build ^(%1^) + shift + goto:parameterLoop + ) + + echo. + echo Unrecognized option "%1" + echo. + echo usage: update_external_sources.bat [options] + echo. + echo Available options: + echo -g ^| --glslang enable glslang component + echo -s ^| --spirv-tools enable spirv-tools component + echo --all enable all components + echo --no-sync skip sync from git + echo --no-build skip build + echo. + echo Sync uses git to pull a specific revision. + echo Build configures CMake, builds Release and Debug. + goto:error :parameterContinue + if %arg-use-implicit-component-list% equ 1 ( + echo Building glslang, spirv-tools + set arg-do-glslang=1 + set arg-do-spirv-tools=1 + ) + + set sync-glslang=0 + set sync-spirv-tools=0 + set build-glslang=0 + set build-spirv-tools=0 + set check-glslang-build-dependencies=0 + + if %arg-do-glslang% equ 1 ( + if %arg-no-sync% equ 0 ( + set sync-glslang=1 + ) + if %arg-no-build% equ 0 ( + set check-glslang-build-dependencies=1 + set build-glslang=1 + ) + ) + + if %arg-do-spirv-tools% equ 1 ( + if %arg-no-sync% equ 0 ( + set sync-spirv-tools=1 + ) + if %arg-no-build% equ 0 ( + REM glslang has the same dependencies as spirv-tools + set check-glslang-build-dependencies=1 + set build-spirv-tools=1 + ) + ) + + REM this is a debugging aid that can be enabled while debugging command-line parsing + if 0 equ 1 ( + set arg + set sync-glslang + set sync-spirv-tools + set build-glslang + set build-spirv-tools + set check-glslang-build-dependencies + goto:error + ) + REM // ======== end Parameter parsing ======== // |
