[Piglit] [PATCH 55/63] CMake: search for glslangValidator, spirv-dis if needed
Alejandro PiƱeiro
apinheiro at igalia.com
Sat Feb 23 23:45:43 UTC 2019
If we are generating SPIR-V tests using already existing tests, we
would need both programs.
Note that we are not removing the option to configure where those
binaries are on the script using envvars, as that can be handy if you
want to use glslang from master compiled by yourself, and having
glslang from system installed.
---
CMakeLists.txt | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 435c40ea5..d5e9de3a9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,6 +52,23 @@ option(PIGLIT_BUILD_CL_TESTS "Build tests for OpenCL" OFF)
option(PIGLIT_GENERATE_GL_SPIRV_TESTS
"Generate ARB_gl_spirv tests by converting GLSL shader_tests to SPIR-V" OFF)
+if (PIGLIT_GENERATE_GL_SPIRV_TESTS)
+ find_program(GLSLANG_VALIDATOR_FOUND glslangValidator)
+ find_program(SPIRV_DIS_FOUND spirv-dis)
+
+ if(NOT GLSLANG_VALIDATOR_FOUND)
+ message(FATAL_ERROR "Failed fo find glslangValidator, needed to "
+ "generate the ARB_gl_spirv generated tests."
+ )
+ endif()
+
+ if(NOT SPIRV_DIS_FOUND)
+ message(FATAL_ERROR "Failed to find spirv-dis, needed "
+ "to generate the ARB_gl_spirv generated tests."
+ )
+ endif()
+endif()
+
if(PIGLIT_BUILD_GL_TESTS)
find_package(OpenGL REQUIRED)
endif()
--
2.19.1
More information about the Piglit
mailing list