Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Headers.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEhsan Nasiri <ehsannas@gmail.com>2019-09-23 21:38:23 +0300
committerEhsan Nasiri <ehsannas@gmail.com>2019-09-23 21:39:52 +0300
commitab22babed072a2456502162d44c9583aa9a0084e (patch)
treeb9627ec0a882e15efe6681b5fa8ea63c26c475fd /README.md
parent4163b36393b353af12797392c6b4e239c31fb173 (diff)
Update documentation.
Diffstat (limited to 'README.md')
-rw-r--r--README.md46
1 files changed, 46 insertions, 0 deletions
diff --git a/README.md b/README.md
index beb1b7e..27b393a 100644
--- a/README.md
+++ b/README.md
@@ -53,6 +53,7 @@ If you want to install them somewhere else, then use
## Using the headers without installing
+### Using CMake
A CMake-based project can use the headers without installing, as follows:
1. Add an `add_subdirectory` directive to include this source tree.
@@ -69,6 +70,51 @@ A CMake-based project can use the headers without installing, as follows:
See also the [example](example/) subdirectory. But since that example is
*inside* this repostory, it doesn't use and `add_subdirectory` directive.
+### Using Bazel
+A Bazel-based project can use the headers without installing, as follows:
+
+1. Add a `local_repository` to your `WORKSPACE` file. For example:
+```
+local_repository(
+ name = "spirv_headers",
+ path = "external/spirv-headers",
+)
+```
+
+2. Add one of the following to the `deps` of your build target based on your
+needs:
+```
+@spirv_headers//:spirv_c_headers
+@spirv_headers//:spirv_cpp_headers
+@spirv_headers//:spirv_cpp11_headers
+```
+
+For example:
+
+```
+cc_library(
+ name = "project",
+ srcs = [
+ # Path to project sources
+ ],
+ hdrs = [
+ # Path to project headers
+ ],
+ deps = [
+ "@spirv_tools//:spirv_c_headers",
+ # Other dependencies,
+ ],
+)
+```
+
+3. In your C or C++ source code use `#include` directives that explicitly mention
+ the `spirv` path component.
+```
+#include "spirv/unified1/GLSL.std.450.h"
+#include "spirv/unified1/OpenCL.std.h"
+#include "spirv/unified1/spirv.hpp"
+```
+
## Generating the headers from the JSON grammar
This will generally be done by Khronos, for a change to the JSON grammar.