mirror of
https://github.com/KhronosGroup/glslang
synced 2024-11-08 11:30:06 +00:00
Look for external SPIR-V Tools build, if not building in-tree
This allows to build with optimizer enabled, if external SPIR-V tools libraries are available in the system. It is quite common in *nix world to package spirv-tools and glslang separately. Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
This commit is contained in:
parent
b70669a059
commit
3805888a57
@ -264,8 +264,15 @@ if(BUILD_EXTERNAL AND IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/External)
|
||||
add_subdirectory(External)
|
||||
endif()
|
||||
|
||||
option(ALLOW_EXTERNAL_SPIRV_TOOLS "Allows to build against installed SPIRV-Tools-opt" OFF)
|
||||
if(NOT TARGET SPIRV-Tools-opt)
|
||||
set(ENABLE_OPT OFF)
|
||||
if(ALLOW_EXTERNAL_SPIRV_TOOLS)
|
||||
# Look for external SPIR-V Tools build, if not building in-tree
|
||||
find_package(SPIRV-Tools-opt)
|
||||
endif()
|
||||
if(NOT TARGET SPIRV-Tools-opt)
|
||||
set(ENABLE_OPT OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ENABLE_OPT)
|
||||
|
Loading…
Reference in New Issue
Block a user