diff options
author | José Fonseca <jfonseca@vmware.com> | 2014-06-09 15:51:53 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2014-06-10 11:14:06 +0100 |
commit | 26f5404d1d5bc23731ebcde5ba79060885927ee3 (patch) | |
tree | ba94c7bccf915458eaef5824e0753a02fa59610e /cmake | |
parent | 058e0f8a1e536b68ef43d27ada80645845a39e19 (diff) |
util/framework/glut: Auto-detect glutInitErrorFunc support.
Should fix https://bugs.freedesktop.org/show_bug.cgi?id=79745
Tested-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/target_api/gl/CMakeLists.txt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cmake/target_api/gl/CMakeLists.txt b/cmake/target_api/gl/CMakeLists.txt index 0a3c3b79a..d7084d6ce 100644 --- a/cmake/target_api/gl/CMakeLists.txt +++ b/cmake/target_api/gl/CMakeLists.txt @@ -11,6 +11,17 @@ if(NOT PIGLIT_USE_WAFFLE) link_libraries( ${GLUT_glut_LIBRARY} ) + + # Check if glutInitErrorFunc is available + if (NOT APPLE) + include(CheckSymbolExists) + set(CMAKE_REQUIRED_INCLUDES "${GLUT_INCLUDE_DIR}") + set(CMAKE_REQUIRED_LIBRARIES "${GLUT_glut_LIBRARY}") + check_symbol_exists ("glutInitErrorFunc" "GL/glut.h;GL/freeglut_ext.h" PIGLIT_USE_GLUT_INIT_ERROR_FUNC) + if (PIGLIT_USE_GLUT_INIT_ERROR_FUNC) + add_definitions(-DPIGLIT_USE_GLUT_INIT_ERROR_FUNC) + endif () + endif () endif() add_subdirectory(${piglit_SOURCE_DIR}/tests |