repo: Reorg to remove Vulkan-Headers submodule
[platform/upstream/Vulkan-Tools.git] / BUILD.md
1 # Build Instructions
2
3 Instructions for building this repository on Linux, Windows, Android, and MacOS.
4
5 ## Index
6
7 1. [Contributing](#contributing-to-the-repository)
8 2. [Repository Set-Up](#repository-set-up)
9 3. [Windows Build](#building-on-windows)
10 4. [Linux Build](#building-on-linux)
11 5. [Android Build](#building-on-android)
12 6. [MacOS build](#building-on-macos)
13
14 ## Contributing to the Repository
15
16 If you intend to contribute, the preferred work flow is for you to develop
17 your contribution in a fork of this repository in your GitHub account and
18 then submit a pull request.
19 Please see the [CONTRIBUTING.md](CONTRIBUTING.md) file in this repository for more details.
20
21 ## Repository Set-Up
22
23 ### Display Drivers
24
25 This repository does not contain a Vulkan-capable driver.
26 Before proceeding, it is strongly recommended that you obtain a Vulkan driver from your
27 graphics hardware vendor and install it properly.
28
29 ### Download the Repository
30
31 To create your local git repository:
32
33     git clone https://github.com/KhronosGroup/Vulkan-Tools.git
34
35 ## Building On Windows
36
37 ### Windows Build Requirements
38
39 Windows 7+ with the following software packages:
40
41 - Microsoft Visual Studio 2013 Update 4 Professional, VS2015 (any version), or VS2017 (any version).
42 - [CMake](http://www.cmake.org/download/)
43   - Tell the installer to "Add CMake to the system PATH" environment variable.
44 - [Python 3](https://www.python.org/downloads)
45   - Select to install the optional sub-package to add Python to the system PATH
46     environment variable.
47   - Ensure the `pip` module is installed (it should be by default)
48   - Python3.3 or later is necessary for the Windows py.exe launcher that is used to select python3
49   rather than python2 if both are installed
50 - [Git](http://git-scm.com/download/win)
51   - Tell the installer to allow it to be used for "Developer Prompt" as well as "Git Bash".
52   - Tell the installer to treat line endings "as is" (i.e. both DOS and Unix-style line endings).
53   - Install both the 32-bit and 64-bit versions, as the 64-bit installer does not install the
54     32-bit libraries and tools.
55 - Vulkan Headers and Loader Library
56   - Building the cube and vulkaninfo applications require access to the Vulkan headers and linking to the Vulkan Loader Library (vulkan-1.dll).
57     Locating these components can be done in two different ways:
58       -  The Vulkan SDK can be installed. In this case, cmake should be able to locate the headers and loader through the VulkanSDK
59          environment variable.
60       -  The headers can be built from the [Vulkan-Headers](https://github.com/KhronosGroup/Vulkan-Headers.git) repository and the
61          loader library can be built from the [Vulkan-Loader](https://github.com/KhronosGroup/Vulkan-Loader.git) repository.
62          Follow the instructions in those repositories to build the `install` targets.
63          When building this repo,  the following options should be used on the cmake command line:
64
65             VULKAN_HEADERS_INSTALL_DIR=\absolute_path_to\Vulkan-Headers install dir
66             VULKAN_LOADER_INSTALL_DIR=\absolute_path_to\Vulkan-Loader install dir
67          
68          Be sure to use absolute (not relative) paths, like so:
69          
70              cmake -DVULKAN_LOADER_INSTALL_DIR=c:\src\Vulkan-Loader\build\install
71 - [glslang](https://github.com/KhronosGroup/glslang)
72   - By default, the build scripts will attempt to download the necessary components from the glslang repo.
73     However, if a specific version of this file is required, please see the [Custom glslang Version](#custom-glslang-version) section below.
74
75 ### Windows Build - Microsoft Visual Studio
76
77 1. Open a Developer Command Prompt for VS201x
78 2. Change directory to `Vulkan-Tools` -- the root of the cloned git repository
79 3. Create a `build` directory, change into that directory, and run cmake
80
81 For example, assuming an SDK is installed, for VS2017 (generators for other versions are [specified here](#cmake-visual-studio-generators)):
82
83     cmake -G "Visual Studio 15 2017 Win64" ..
84
85 If a specific version of the Headers or Loader is requred, specify the install dirs of these repositories, like so:
86
87     cmake -DVULKAN_HEADERS_INSTALL_PATH=c:/absolute_path_to/Vulkan-Headers install dir
88           -DVULKAN_LOADER_INSTALL_PATH=c:/absolute_path_to/Vulkan-Loader install dir
89           -G "Visual Studio 15 2017 Win64" ..
90
91 This will create a Windows solution file named `Vulkan-Tools.sln` in the build directory.
92
93 Launch Visual Studio and open the "Vulkan-Tools.sln" solution file in the build folder.
94 You may select "Debug" or "Release" from the Solution Configurations drop-down list.
95 Start a build by selecting the Build->Build Solution menu item.
96 This solution copies the loader it built to each program's build directory
97 to ensure that the program uses the loader built from this solution.
98
99 You can also build from the command line with:
100
101     cmake --build . --config (Release or Debug)
102
103 #### Windows Install Target
104
105 The CMake project also generates an "install" target that you can use to
106 copy the primary build artifacts to a specific location using a
107 "bin, include, lib" style directory structure.
108 This may be useful for collecting the artifacts and providing them to
109 another project that is dependent on them.
110
111 The default location is `$CMAKE_BINARY_DIR\install`, but can be changed
112 with the `CMAKE_INSTALL_PREFIX` variable.
113 You can build the install target with:
114
115     cmake --build . --config Release --target install
116
117 or build the `INSTALL` target from the Visual Studio solution explorer.
118
119 ### Windows Notes
120
121 #### CMake Visual Studio Generators
122
123 The above example used Visual Studio 2017, and specified its generator as "Visual Studio 15 2017 Win64".
124 The chosen generator should match your Visual Studio version. Appropriate Visual Studio generators include:
125
126 | Build Platform               | 64-bit Generator              | 32-bit Generator        |
127 |------------------------------|-------------------------------|-------------------------|
128 | Microsoft Visual Studio 2013 | "Visual Studio 12 2013 Win64" | "Visual Studio 12 2013" |
129 | Microsoft Visual Studio 2015 | "Visual Studio 14 2015 Win64" | "Visual Studio 14 2015" |
130 | Microsoft Visual Studio 2017 | "Visual Studio 15 2017 Win64" | "Visual Studio 15 2017" |
131
132 ## Building On Linux
133
134 ### Linux Build Requirements
135
136 This repository has been built and tested on the two most recent Ubuntu LTS versions.
137 Currently, the oldest supported version is Ubuntu 14.04, meaning that the minimum supported compiler versions are GCC 4.8.2 and Clang 3.4, although earlier versions may work.
138 It should be straightforward to adapt this repository to other Linux distributions.
139
140 **Required Package List:**
141
142     sudo apt-get install git cmake build-essential libx11-xcb-dev libxkbcommon-dev libmirclient-dev libwayland-dev libxrandr-dev
143
144 - [glslang](https://github.com/KhronosGroup/glslang)
145   - By default, the build scripts will attempt to download the necessary components from the glslang repo.
146     However, if a specific version of this file is required, please see the [Custom glslang Version](#custom-glslang-version) section below.
147
148 Vulkan Loader Library
149
150 - Vulkan Headers and Loader Library
151   - Building the cube and vulkaninfo applications require access to the Vulkan headers and linking to the Vulkan Loader Library (libvulkan.so.1).
152     Locating these components can be done in two different ways:
153       -  The Vulkan SDK can be installed. In this case, cmake should be able to locate the headers and loader through the VulkanSDK
154          environment variable.
155       -  The headers are built with the [Vulkan-Headers](https://github.com/KhronosGroup/Vulkan-Headers.git) repository and the
156          loader library can be built from the [Vulkan-Loader](https://github.com/KhronosGroup/Vulkan-Loader.git) repository.
157          Follow the instructions in those repositories to build the `install` targets.
158          When building this repo,  the following options should be used on the cmake command line:
159
160              VULKAN_HEADERS_INSTALL_DIR=absolute_path_to Vulkan-Headers install dir
161              VULKAN_LOADER_INSTALL_DIR=absolute_path_to Vulkan-Loader install dir
162
163          Be sure to use absolute (not relative) paths, like so:
164
165              cmake -DVULKAN_LOADER_INSTALL_DIR=~/src/Vulkan-Loader/build/install
166
167 ### Linux Build
168
169 Example debug build
170
171 See **Loader and Validation Layer Dependencies** for more information and other options:
172
173 1. In a Linux terminal, `cd Vulkan-Tools` -- the root of the cloned git repository
174 2. Create a `build` directory, change into that directory, and run cmake:
175
176         mkdir build
177         cd build
178         # If an SDK is installed and the setup-env.sh script has been run,
179         cmake -DCMAKE_BUILD_TYPE=Debug ..
180         # Else if a specific version of the loader is desired, indicate the root of the loader repository like so:
181         cmake -DVULKAN_HEADERS_INSTALL_DIR=/absolute_path_to/Vulkan-Headers/build/install \
182               -DVULKAN_LOADER_INSTALL_DIR=/absolute_path_to/Vulkan-Loader/build/install \
183               -DCMAKE_BUILD_TYPE=Debug ..
184
185 4. Run `make -j8` to begin the build
186
187 If your build system supports ccache, you can enable that via CMake option `-DUSE_CCACHE=On`
188
189 ### WSI Support Build Options
190
191 By default, the Vulkan Tools cube and cubepp are built with support for all 4 Vulkan-defined WSI display servers: Xcb, Xlib, Wayland, and Mir.
192 It is recommended to build the repository components with support for these display servers to maximize their usability across Linux platforms.
193 If it is necessary to build these modules without support for one of the display servers, the appropriate CMake option of the form `BUILD_WSI_xxx_SUPPORT` can be set to `OFF`.
194 See the CMakeLists.txt file in `Vulkan-Tools/cube` for more info.
195
196 Note vulkaninfo currently only supports Xcb and Xlib WSI display servers.  See the CMakeLists.txt file in `Vulkan-Tools/vulkaninfo` for more info.
197
198 ### Linux Install to System Directories
199
200 Installing the files resulting from your build to the systems directories is optional since environment variables can usually be used instead to locate the binaries.
201 There are also risks with interfering with binaries installed by packages.
202 If you are certain that you would like to install your binaries to system directories, you can proceed with these instructions.
203
204 Assuming that you have built the code as described above and the current directory is still `build`, you can execute:
205
206     sudo make install
207
208 This command installs files to:
209
210 - `/usr/local/lib`:  Vulkan Tools shared objects  (e.g., Mock ICD shared library)
211 - `/usr/local/bin`:  cube, cubepp, and vulkaninfo applications
212 - `/usr/local/share/vulkan/icd.d`:  Mock ICD JSON file
213
214 You may need to run `ldconfig` in order to refresh the system loader search cache on some Linux systems.
215
216 Note:  The Mock ICD is not installed by default since it is a "null" driver that does not render anything
217 and is used for testing purposes.
218 Installing it to system directories may cause some applications to discover and use
219 this driver instead of other full drivers installed on the system.
220 If you really want to install this null driver, use:
221
222     -DINSTALL_ICD=ON
223
224 You can further customize the installation location by setting additional CMake variables to override their defaults.
225 For example, if you would like to install to `/tmp/build` instead of `/usr/local`, on your CMake command line specify:
226
227     -DCMAKE_INSTALL_PREFIX=/tmp/build
228     -DDEST_DIR=/tmp/build
229
230 Then run `make install` as before. The install step places the files in `/tmp/build`.
231
232 You can further customize the installation directories by using the CMake variables
233 `CMAKE_INSTALL_SYSCONFDIR` to rename the `etc` directory and `CMAKE_INSTALL_DATADIR`
234 to rename the `share` directory.
235
236 See the CMake documentation for more details on using these variables
237 to further customize your installation.
238
239 ### Linux Uninstall
240
241 To uninstall the files from the system directories, you can execute:
242
243     sudo make uninstall-Vulkan-Tools
244
245 ### Linux Tests
246
247 After making any changes to the repository, you should perform some quick sanity tests, such as
248 running the cube demo with validation enabled.
249
250 To run the **Cube application** with validation, in a terminal change to the `build/cube`
251 directory and run:
252
253     VK_LAYER_PATH=../path/to/validation/layers ./cube --validate
254
255 You can select which WSI subsystem is used to build the cube applications using a CMake option
256 called DEMOS_WSI_SELECTION.
257 Supported options are XCB (default), XLIB, WAYLAND, and MIR.
258 Note that you must build using the corresponding BUILD_WSI_*_SUPPORT enabled at the
259 base repository level (all SUPPORT options are ON by default).
260 For instance, creating a build that will use Xlib to build the demos,
261 your CMake command line might look like:
262
263     cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DDEMOS_WSI_SELECTION=XLIB
264
265 ### Linux Notes
266
267 #### Linux 32-bit support
268
269 Usage of the contents of this repository in 32-bit Linux environments is not officially supported.
270 However, since this repository is supported on 32-bit Windows,
271 these modules should generally work on 32-bit Linux.
272
273 Here are some notes for building 32-bit targets on a 64-bit Ubuntu "reference" platform:
274
275 If not already installed, install the following 32-bit development libraries:
276
277 `gcc-multilib g++-multilib libx11-dev:i386`
278
279 This list may vary depending on your distribution and which windowing systems you are building for.
280
281 Set up your environment for building 32-bit targets:
282
283     export ASFLAGS=--32
284     export CFLAGS=-m32
285     export CXXFLAGS=-m32
286     export PKG_CONFIG_LIBDIR=/usr/lib/i386-linux-gnu
287
288 Again, your PKG_CONFIG configuration may be different, depending on your distribution.
289
290 Finally, rebuild the repository using `cmake` and `make`, as explained above.
291
292 ## Building On Android
293
294 Install the required tools for Linux and Windows covered above, then add the following.
295
296 ### Android Build Requirements
297
298 - Install [Android Studio 2.3](https://developer.android.com/studio/index.html) or later.
299 - From the "Welcome to Android Studio" splash screen, add the following components using
300   Configure > SDK Manager:
301   - SDK Platforms > Android 6.0 and newer
302   - SDK Tools > Android SDK Build-Tools
303   - SDK Tools > Android SDK Platform-Tools
304   - SDK Tools > Android SDK Tools
305   - SDK Tools > NDK
306
307 #### Add Android specifics to environment
308
309 For each of the below, you may need to specify a different build-tools version, as Android Studio will roll it forward fairly regularly.
310
311 On Linux:
312
313     export ANDROID_SDK_HOME=$HOME/Android/sdk
314     export ANDROID_NDK_HOME=$HOME/Android/sdk/ndk-bundle
315     export PATH=$ANDROID_SDK_HOME:$PATH
316     export PATH=$ANDROID_NDK_HOME:$PATH
317     export PATH=$ANDROID_SDK_HOME/build-tools/23.0.3:$PATH
318
319 On Windows:
320
321     set ANDROID_SDK_HOME=%LOCALAPPDATA%\Android\sdk
322     set ANDROID_NDK_HOME=%LOCALAPPDATA%\Android\sdk\ndk-bundle
323     set PATH=%LOCALAPPDATA%\Android\sdk\ndk-bundle;%PATH%
324
325 On OSX:
326
327     export ANDROID_SDK_HOME=$HOME/Library/Android/sdk
328     export ANDROID_NDK_HOME=$HOME/Library/Android/sdk/ndk-bundle
329     export PATH=$ANDROID_NDK_PATH:$PATH
330     export PATH=$ANDROID_SDK_HOME/build-tools/23.0.3:$PATH
331
332 Note: If `jarsigner` is missing from your platform, you can find it in the
333 Android Studio install or in your Java installation.
334 If you do not have Java, you can get it with something like the following:
335
336   sudo apt-get install openjdk-8-jdk
337
338 #### Additional OSX System Requirements
339
340 Tested on OSX version 10.13.3
341
342 Setup Homebrew and components
343
344 - Follow instructions on [brew.sh](http://brew.sh) to get Homebrew installed.
345
346       /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
347
348 - Ensure Homebrew is at the beginning of your PATH:
349
350       export PATH=/usr/local/bin:$PATH
351
352 - Add packages with the following:
353
354       brew install cmake python
355
356 ### Android Build
357
358 There are two options for building the Android tools.
359 Either using the SPIRV tools provided as part of the Android NDK, or using upstream sources.
360 To build with SPIRV tools from the NDK, remove the build-android/third_party directory created by
361 running update_external_sources_android.sh, (or avoid running update_external_sources_android.sh).
362 Use the following script to build everything in the repository for Android, including validation
363 layers, tests, demos, and APK packaging: This script does retrieve and use the upstream SPRIV tools.
364
365     cd build-android
366     ./build_all.sh
367
368 Test and application APKs can be installed on production devices with:
369
370     ./install_all.sh [-s <serial number>]
371
372 Note that there are no equivalent scripts on Windows yet, that work needs to be completed.
373 The following per platform commands can be used for layer only builds:
374
375 #### Linux and OSX
376
377 Follow the setup steps for Linux or OSX above, then from your terminal:
378
379     cd build-android
380     ./update_external_sources_android.sh --no-build
381     ./android-generate.sh
382     ndk-build -j4
383
384 #### Windows
385
386 Follow the setup steps for Windows above, then from Developer Command Prompt for VS2013:
387
388     cd build-android
389     update_external_sources_android.bat
390     android-generate.bat
391     ndk-build
392
393 ### Android Tests and Demos
394
395 After making any changes to the repository you should perform some quick sanity tests,
396 including the layer validation tests and the cube and smoke demos with validation enabled.
397
398 #### Run Layer Validation Tests
399
400 Use the following steps to build, install, and run the layer validation tests for Android:
401
402     cd build-android
403     ./build_all.sh
404     adb install -r bin/VulkanLayerValidationTests.apk
405     adb shell am start com.example.VulkanLayerValidationTests/android.app.NativeActivity
406
407 Alternatively, you can use the test_APK script to install and run the layer validation tests:
408
409     test_APK.sh -s <serial number> -p <plaform name> -f <gtest_filter>
410
411 #### Run Cube with Validation
412
413 TODO: This must be reworked to pull in layers from the ValidationLayers repo
414
415 Use the following steps to build, install, and run Cube for Android:
416
417     cd build-android
418     ./build_all.sh
419     adb install -r ../demos/android/cube/bin/cube.apk
420     adb shell am start com.example.Cube/android.app.NativeActivity
421
422 To build, install, and run Cube with validation layers,
423 first build layers using steps above, then run:
424
425     cd build-android
426     ./build_all.sh
427     adb install -r ../demos/android/cube-with-layers/bin/cube-with-layers.apk
428
429 ##### Run without validation enabled
430
431     adb shell am start com.example.CubeWithLayers/android.app.NativeActivity
432
433 ##### Run with validation enabled
434
435     adb shell am start -a android.intent.action.MAIN -c android-intent.category.LAUNCH -n com.example.CubeWithLayers/android.app.NativeActivity --es args "--validate"
436
437 ## Building on MacOS
438
439 ### MacOS Build Requirements
440
441 Tested on OSX version 10.12.6
442
443 Setup Homebrew and components
444
445 - Follow instructions on [brew.sh](http://brew.sh) to get Homebrew installed.
446
447       /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
448
449 - Ensure Homebrew is at the beginning of your PATH:
450
451       export PATH=/usr/local/bin:$PATH
452
453 - Add packages with the following (may need refinement)
454
455       brew install cmake python python3 git
456
457 - [glslang](https://github.com/KhronosGroup/glslang)
458   - By default, the build scripts will attempt to download the necessary components from the glslang repo.
459     However, if a specific version of this file is required, please see the [Custom glslang Version](#custom-glslang-version) section below.
460
461 ### Clone the Repository
462
463 Clone the Vulkan-Tools repository as defined above in the [Download the Repository](#download-the-repository) section.
464
465 ### Get the External Libraries
466
467 [MoltenVK](https://github.com/KhronosGroup/MoltenVK) Library
468
469 - Building the cube and vulkaninfo applications require linking to the MoltenVK Library (libMoltenVK.dylib)
470   - The following option should be used on the cmake command line to specify a vulkan loader library:
471     MOLTENVK_REPO_ROOT=/absolute_path_to/MoltenVK making sure to specify an absolute path, like so:
472     cmake -DMOLTENVK_REPO_ROOT=/absolute_path_to/MoltenVK ....
473
474 Vulkan Loader Library
475
476 - Building the cube and vulkaninfo applications require linking to the Vulkan Loader Library (libvulkan.1.dylib)
477   - The following option should be used on the cmake command line to specify a vulkan loader library:
478     LOADER_REPO_ROOT=/absolute_path_to/Vulkan-Loader making sure to specify an absolute path, like so:
479     cmake -DLOADER_REPO_ROOT=/absolute_path_to/Vulkan-Loader ....
480
481 ### MacOS build
482
483 #### CMake Generators
484
485 This repository uses CMake to generate build or project files that are
486 then used to build the repository.
487 The CMake generators explicitly supported in this repository are:
488
489 - Unix Makefiles
490 - Xcode
491
492 #### Building with the Unix Makefiles Generator
493
494 This generator is the default generator, so all that is needed for a debug
495 build is:
496
497         mkdir build
498         cd build
499         cmake -DCMAKE_BUILD_TYPE=Debug -DLOADER_REPO_ROOT=/absolute_path_to/Vulkan-Loader -DMOLTENVK_REPO_ROOT=/absolute_path_to/MoltenVK ..
500         make
501
502 To speed up the build on a multi-core machine, use the `-j` option for `make`
503 to specify the number of cores to use for the build.
504 For example:
505
506     make -j4
507
508 You can now run the demo applications from the command line:
509
510     open cube/cube.app
511     open cube/cubepp.app
512     open vulkaninfo/vulkaninfo.app
513
514 Or you can locate them from `Finder` and launch them from there.
515
516 ##### The Install Target and RPATH
517
518 The applications you just built are "bundled applications", but the executables
519 are using the `RPATH` mechanism to locate runtime dependencies that are still
520 in your build tree.
521
522 To see this, run this command from your `build` directory:
523
524     otool -l cube/cube.app/Contents/MacOS/cube
525
526 and note that the `cube` executable contains loader commands:
527
528 - `LC_LOAD_DYLIB` to load `libvulkan.1.dylib` via an `@rpath`
529 - `LC_RPATH` that contains an absolute path to the build location of the Vulkan loader
530
531 This makes the bundled application "non-transportable", meaning that it won't run
532 unless the Vulkan loader is on that specific absolute path.
533 This is useful for debugging the loader or other components built in this repository,
534 but not if you want to move the application to another machine or remove your build tree.
535
536 To address this problem, run:
537
538     make install
539
540 This step "cleans up" the `RPATH` to remove any external references
541 and performs other bundle fix-ups.
542 After running `make install`, re-run the `otool` command again and note:
543
544 - `LC_LOAD_DYLIB` is now `@executable_path/../MacOS/libvulkan.1.dylib`
545 - `LC_RPATH` is no longer present
546
547 The "bundle fix-up" operation also puts a copy of the Vulkan loader into the bundle,
548 making the bundle completely self-contained and self-referencing.
549
550 Note that the "install" target has a very different meaning compared to the Linux
551 "make install" target.
552 The Linux "install" copies the targets to system directories.
553 In MacOS, "install" means fixing up application bundles.
554 In both cases, the "install" target operations clean up the `RPATH`.
555
556 ##### The Non-bundled vulkaninfo Application
557
558 There is also a non-bundled version of the `vulkaninfo` application that you can
559 run from the command line:
560
561     vulkaninfo/vulkaninfo
562
563 If you run this before you run "make install", vulkaninfo's RPATH is already set
564 to point to the Vulkan loader in the build tree, so it has no trouble finding it.
565 But the loader will not find the MoltenVK driver and you'll see a message about an
566 incompatible driver.  To remedy this:
567
568     VK_ICD_FILENAMES=<path-to>/MoltenVK/Package/Latest/MoltenVK/macOS/MoltenVK_icd.json demos/vulkaninfo
569
570 If you run `vulkaninfo` after doing a "make install", the `RPATH` in the `vulkaninfo` application
571 got removed and the OS needs extra help to locate the Vulkan loader:
572
573     DYLD_LIBRARY_PATH=<path-to>/Vulkan-Loader/loader VK_ICD_FILENAMES=<path-to>/MoltenVK/Package/Latest/MoltenVK/macOS/MoltenVK_icd.json demos/vulkaninfo
574
575 #### Building with the Xcode Generator
576
577 To create and open an Xcode project:
578
579         mkdir build-xcode
580         cd build-xcode
581         cmake -DLOADER_REPO_ROOT=/absolute_path_to/Vulkan-Loader -DMOLTENVK_REPO_ROOT=/absolute_path_to/MoltenVK -GXcode ..
582         open VULKAN.xcodeproj
583
584 Within Xcode, you can select Debug or Release builds in the project's Build Settings.
585 You can also select individual schemes for working with specific applications like `cube`.
586
587 ## Ninja Builds - All Platforms
588
589 The [Qt Creator IDE](https://qt.io/download-open-source/#section-2) can open a root CMakeList.txt
590 as a project directly, and it provides tools within Creator to configure and generate Vulkan SDK
591 build files for one to many targets concurrently.
592 Alternatively, when invoking CMake, use the `-G "Codeblocks - Ninja"` option to generate Ninja build
593 files to be used as project files for QtCreator
594
595 - Open, configure, and build the Vulkan-Tools CMakeList.txt file
596 - In order to debug with QtCreator, a
597   [Microsoft WDK: eg WDK 10](http://go.microsoft.com/fwlink/p/?LinkId=526733) is required.
598
599 Note that installing the WDK breaks the MSVC vcvarsall.bat build scripts provided by MSVC,
600 requiring that the LIB, INCLUDE, and PATHenv variables be set to the WDK paths by some other means
601
602 ## Custom glslang version
603
604 The Glslang repository is not a git sub-module of Vulkan-Tools, but glslang components are required to build
605 the cube and cubepp applications. By default, the cmake scripts will download the required
606 components into the repo 'glslang' directory.
607
608 If a *specific* version of the glslang components is desired, perform the following steps:
609
610 1) clone the glslang repository:
611
612     `git clone https://github.com/KhronosGroup/glslang.git`
613
614 2) Configure the glslang source tree with CMake and build it with your IDE of choice, following the instructions
615    in the glslang BUILD.md document including using the INSTALL_PREFIX and 'make install'. Note the install directory.
616
617 3) Pass the location of the glslang install directory using an absolute path via your cmake command like so:
618
619     cmake -DGLSLANG_INSTALL_DIR=c:\absolute_path_to\glslang\build\install
620
621 ## Optional software packages
622
623 - [Cygwin for windows](https://www.cygwin.com/)
624   - Cygwin provides some Linux-like tools, which can be valuable for working with the repository,
625     such as the BASH shell and git packages
626   - With appropriate adjustments, it is possible to use other shells and environments as well
627
628 - [Ninja on all platforms](https://github.com/ninja-build/ninja/releases)
629 - [The Ninja-build project](https://ninja-build.org)
630 - [Ninja Users Manual](https://ninja-build.org/manual.html)
631
632 - [QtCreator as IDE for CMake builds on all platforms](https://qt.io/download-open-source/#section-2)