Skip to content

Commit

Permalink
If SPIRV-Headers is in our tree, include it as subproject (KhronosGro…
Browse files Browse the repository at this point in the history
…up#3299)

This allows enclosing projects to use SPIRV-Headers_SOURCE_DIR
to set up in header includes.
  • Loading branch information
dneto0 authored Apr 14, 2020
1 parent e70d25f commit ca57515
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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/.")
Expand Down

0 comments on commit ca57515

Please sign in to comment.