[Piglit] [PATCH] add a PIGLIT_BUILD_GL_TESTS option
groleo at gmail.com
groleo at gmail.com
Thu Oct 18 10:37:28 PDT 2012
From: Adrian Marius Negreanu <adrian.m.negreanu at intel.com>
The GL tests are compiled unconditionally.
This breaks on systems that dont't have a GL library
Signed-off-by: Adrian Marius Negreanu <adrian.m.negreanu at intel.com>
---
CMakeLists.txt | 8 +++++++-
cmake/target_api/CMakeLists.txt | 4 +++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fce260c..63139e9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,17 +10,23 @@ INCLUDE (FindPkgConfig)
project (piglit)
-find_package(OpenGL REQUIRED)
find_package(TIFF)
find_package(GLUT REQUIRED)
find_package(PNG REQUIRED)
find_package(X11)
+option(PIGLIT_BUILD_GL_TESTS "Build tests for OpenGL" ON)
option(PIGLIT_BUILD_GLES1_TESTS "Build tests for OpenGL ES1" OFF)
option(PIGLIT_BUILD_GLES2_TESTS "Build tests for OpenGL ES2" OFF)
option(PIGLIT_BUILD_CL_TESTS "Build tests for OpenCL" OFF)
+if(PIGLIT_BUILD_GL_TESTS)
+ find_package(OpenGL REQUIRED)
+else()
+ find_package(OpenGL)
+endif()
+
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
option(PIGLIT_USE_WAFFLE "Use Waffle in place of GLUT" ON)
else()
diff --git a/cmake/target_api/CMakeLists.txt b/cmake/target_api/CMakeLists.txt
index 8ef89c4..e81c0b5 100644
--- a/cmake/target_api/CMakeLists.txt
+++ b/cmake/target_api/CMakeLists.txt
@@ -23,7 +23,9 @@
# api-independent libraries on which the api-dependent targets rely.
add_subdirectory(no_api)
-add_subdirectory(gl)
+if(PIGLIT_BUILD_GL_TESTS)
+ add_subdirectory(gl)
+endif(PIGLIT_BUILD_GL_TESTS)
if(PIGLIT_BUILD_GLES1_TESTS)
add_subdirectory(gles1)
--
1.7.11.3
More information about the Piglit
mailing list