From: Simon Richter Date: Tue, 16 Apr 2013 18:04:42 +0000 (+0200) Subject: Make EGL optional X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=27b862dc6cab1c6ca0fbdaae7493a47688c0bcdf;p=contrib%2Fbeignet.git Make EGL optional This fixes builds if EGL is unavailable. The OpenGL sharing extension will be disabled then. Signed-off-by: Zhigang Gong --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2d15b90..2f590c6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -32,6 +32,9 @@ if (EGL_FOUND) set (OPENCL_SRC ${OPENCL_SRC} cl_mem_gl.c cl_gl_api.c x11/gbm_dri2_x11_platform.c) SET(CMAKE_CXX_FLAGS "-DHAS_EGL ${CMAKE_CXX_FLAGS}") SET(CMAKE_C_FLAGS "-DHAS_EGL ${CMAKE_C_FLAGS}") +SET(OPTIONAL_EGL_LIBRARY "${EGL_LIBRARY}") +else(EGL_FOUND) +SET(OPTIONAL_EGL_LIBRARY "") endif (EGL_FOUND) if (OCLIcd_FOUND) @@ -53,6 +56,6 @@ target_link_libraries( ${DRM_INTEL_LIBRARY} ${DRM_LIBRARY} ${OPENGL_LIBRARIES} - ${EGL_LIBRARY} + ${OPTIONAL_EGL_LIBRARY} ${GBM_LIBRARY}) install (TARGETS cl LIBRARY DESTINATION lib) diff --git a/utests/utest_helper.hpp b/utests/utest_helper.hpp index b52174d..02249e1 100644 --- a/utests/utest_helper.hpp +++ b/utests/utest_helper.hpp @@ -41,6 +41,10 @@ #include #include #include + +extern EGLDisplay eglDisplay; +extern EGLContext eglContext; +extern EGLSurface eglSurface; #endif #define OCL_THROW_ERROR(FN, STATUS) \ @@ -128,10 +132,6 @@ extern cl_mem buf[MAX_BUFFER_N]; extern void* buf_data[MAX_BUFFER_N]; extern size_t globals[3]; extern size_t locals[3]; -extern Display *xDisplay; -extern EGLDisplay eglDisplay; -extern EGLSurface eglSurface; - enum { SOURCE = 0,