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
```
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.
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 ======== //