x11_egl: search for glesv1_cm, toggle DEQP_SUPPORT_GLES1 on if found
authorTapani Pälli <tapani.palli@intel.com>
Wed, 5 Apr 2017 06:39:17 +0000 (09:39 +0300)
committerTapani Pälli <tapani.palli@intel.com>
Wed, 5 Apr 2017 08:38:27 +0000 (11:38 +0300)
Some tests require GLES1 support and report test failure if support
has not been built. Patch changes build time configure to check GLES1
via pkg-config. If it is found, we turn on GLES1 support so that tests
will run and pass.

Change-Id: I586464c5fb7bffc40355caf57b30438f37ce1f6c
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
targets/x11_egl/x11_egl.cmake

index 8e8155b..b36eb30 100644 (file)
@@ -30,5 +30,26 @@ if (NOT X11_FOUND)
        message(FATAL_ERROR "X11 development package not found")
 endif ()
 
+# Support GLES1, we use pkg-config because some distributions do not ship
+# GLES1 libraries and headers, this way user can override search path by
+# using PKG_CONFIG_PATH environment variable
+FIND_PACKAGE(PkgConfig)
+PKG_CHECK_MODULES(GLES1 glesv1_cm)
+if (GLES1_LIBRARIES)
+       set(DEQP_SUPPORT_GLES1  ON)
+       set(DEQP_GLES1_LIBRARIES ${GLES1_LIBRARIES})
+       set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} -L${GLES1_LIBRARY_DIRS})
+       if ("${PKG_GLES1_INCLUDE_DIRS}" STREQUAL "")
+               # PKG_GLES1_INCLUDE_DIRS empty, see if matching include
+               # path (GLES/gl.h) exists beside library directory
+               set(GLES1_INCLUDE "${GLES1_LIBDIR}/../include")
+               if (EXISTS ${GLES1_INCLUDE}/GLES/gl.h)
+                       include_directories(${GLES1_INCLUDE})
+               else()
+                       message(FATAL_ERROR "Could not find include path for GLES1 headers")
+               endif (EXISTS ${GLES1_INCLUDE}/GLES/gl.h)
+       endif ("${PKG_GLES1_INCLUDE_DIRS}" STREQUAL "")
+endif (GLES1_LIBRARIES)
+
 set(DEQP_PLATFORM_LIBRARIES ${X11_LIBRARIES})
 include_directories(${X11_INCLUDE_DIR})