Commit 26f5404d authored by Jose Fonseca's avatar Jose Fonseca

util/framework/glut: Auto-detect glutInitErrorFunc support.

Should fix https://bugs.freedesktop.org/show_bug.cgi?id=79745Tested-by: Vinson Lee's avatarVinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul's avatarBrian Paul <brianp@vmware.com>
parent 058e0f8a
......@@ -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
......
......@@ -128,8 +128,12 @@ init_glut(void)
test_config->window_height);
glutInitDisplayMode(flags);
#ifdef GLUT_CORE_PROFILE
#ifdef PIGLIT_USE_GLUT_INIT_ERROR_FUNC
glutInitErrorFunc(error_func);
#else
(void)error_func;
#endif
#ifdef GLUT_CORE_PROFILE
if (test_config->supports_gl_core_version) {
glutInitContextVersion(test_config->supports_gl_core_version / 10,
test_config->supports_gl_core_version % 10);
......@@ -138,8 +142,6 @@ init_glut(void)
glutInitContextVersion(test_config->supports_gl_compat_version / 10,
test_config->supports_gl_compat_version % 10);
}
#else
(void)error_func;
#endif
glut_fw.window = glutCreateWindow("Piglit");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment