cmake: add more verbose messages if SPIRV-Tools is not found
This makes it more clear to users when SPIR-V optimization is disabled because SPIRV-Tools could not be found, and suggests alternatives for finding it.
This commit is contained in:
parent
0bbe74c709
commit
589431af5c
@ -267,11 +267,20 @@ option(ALLOW_EXTERNAL_SPIRV_TOOLS "Allows to build against installed SPIRV-Tools
|
|||||||
if(NOT TARGET SPIRV-Tools-opt)
|
if(NOT TARGET SPIRV-Tools-opt)
|
||||||
if(ALLOW_EXTERNAL_SPIRV_TOOLS)
|
if(ALLOW_EXTERNAL_SPIRV_TOOLS)
|
||||||
# Look for external SPIR-V Tools build, if not building in-tree
|
# Look for external SPIR-V Tools build, if not building in-tree
|
||||||
|
message(STATUS "Trying to find local SPIR-V tools")
|
||||||
find_package(SPIRV-Tools-opt)
|
find_package(SPIRV-Tools-opt)
|
||||||
endif()
|
|
||||||
if(NOT TARGET SPIRV-Tools-opt)
|
if(NOT TARGET SPIRV-Tools-opt)
|
||||||
|
if(ENABLE_OPT)
|
||||||
|
message(WARNING "ENABLE_OPT set but SPIR-V tools not found! Disabling SPIR-V optimization.")
|
||||||
|
endif()
|
||||||
set(ENABLE_OPT OFF)
|
set(ENABLE_OPT OFF)
|
||||||
endif()
|
endif()
|
||||||
|
else()
|
||||||
|
if(ENABLE_OPT)
|
||||||
|
message(SEND_ERROR "ENABLE_OPT set but SPIR-V tools not found. Please run update_glslang_sources.py, "
|
||||||
|
"set the ALLOW_EXTERNAL_SPIRV_TOOLS option to use a local install of SPIRV-Tools, or set ENABLE_OPT=0.")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(ENABLE_OPT)
|
if(ENABLE_OPT)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user