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

github.com/KhronosGroup/SPIRV-Tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Neto <dneto@google.com>2020-04-14 18:28:25 +0300
committerGitHub <noreply@github.com>2020-04-14 18:28:25 +0300
commitca5751590ed751fba8abaae9b345663002878865 (patch)
treed821ae0cf7ba943cb1603336315ef71e5c55b60c /external
parente70d25f6fa5d6a560f621aaaf6505472be8cc069 (diff)
If SPIRV-Headers is in our tree, include it as subproject (#3299)
This allows enclosing projects to use SPIRV-Headers_SOURCE_DIR to set up in header includes.
Diffstat (limited to 'external')
-rw-r--r--external/CMakeLists.txt10
1 files changed, 10 insertions, 0 deletions
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt
index 8bde13ca1..3c7b40331 100644
--- a/external/CMakeLists.txt
+++ b/external/CMakeLists.txt
@@ -25,7 +25,17 @@ else()
endif()
if (IS_DIRECTORY ${SPIRV_HEADER_DIR})
+ # TODO(dneto): We should not be modifying the parent scope.
set(SPIRV_HEADER_INCLUDE_DIR ${SPIRV_HEADER_DIR}/include PARENT_SCOPE)
+
+ # Add SPIRV-Headers as a sub-project if it isn't already defined.
+ # Do this so enclosing projects can use SPIRV-Headers_SOURCE_DIR to find
+ # headers to include.
+ if (NOT DEFINED SPIRV-Headers_SOURCE_DIR)
+ set(SPIRV_HEADERS_SKIP_INSTALL ON)
+ set(SPIRV_HEADERS_SKIP_EXAMPLES ON)
+ add_subdirectory(${SPIRV_HEADER_DIR})
+ endif()
else()
message(FATAL_ERROR
"SPIRV-Headers was not found - please checkout a copy under external/.")