summaryrefslogtreecommitdiff
path: root/retrace
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2013-11-29 19:32:54 +0000
committerJosé Fonseca <jfonseca@vmware.com>2013-11-29 19:33:32 +0000
commit7c388484658630aa29d8ac5214dbe0108f8afa66 (patch)
treed472fc966e3dfbec6fa9e841000bea717ee08f82 /retrace
parent97244f9fa2ef8eaef1cdb3f8fab6b8e857890a82 (diff)
eglretrace: Allow to build eglretrace with Waffle on desktop systems.
One needs to set ENABLE_WAFFLE and the Waffle_* variables manually. This allows to reproduce issue #197 outside Android.
Diffstat (limited to 'retrace')
-rw-r--r--retrace/CMakeLists.txt13
-rw-r--r--retrace/glws_waffle.cpp17
2 files changed, 21 insertions, 9 deletions
diff --git a/retrace/CMakeLists.txt b/retrace/CMakeLists.txt
index 010368f4..4e37979c 100644
--- a/retrace/CMakeLists.txt
+++ b/retrace/CMakeLists.txt
@@ -41,11 +41,6 @@ add_library (retrace_common STATIC
json.cpp
)
-if (ENABLE_EGL AND ANDROID)
- # if waffle is found eglretrace will be built for Android.
- find_package (Waffle)
-endif ()
-
target_link_libraries (retrace_common
image
common
@@ -119,7 +114,7 @@ if (WIN32 OR APPLE OR X11_FOUND)
install (TARGETS glretrace RUNTIME DESTINATION bin)
endif ()
-if (ENABLE_EGL AND X11_FOUND AND NOT WIN32 AND NOT APPLE)
+if (ENABLE_EGL AND X11_FOUND AND NOT WIN32 AND NOT APPLE AND NOT ENABLE_WAFFLE)
add_executable (eglretrace
glws_egl_xlib.cpp
)
@@ -145,7 +140,7 @@ if (ENABLE_EGL AND X11_FOUND AND NOT WIN32 AND NOT APPLE)
install (TARGETS eglretrace RUNTIME DESTINATION bin)
endif ()
-if (ENABLE_EGL AND ANDROID AND Waffle_FOUND)
+if (ENABLE_EGL AND (ANDROID OR ENABLE_WAFFLE) AND Waffle_FOUND)
add_executable (eglretrace
glws_waffle.cpp
)
@@ -157,8 +152,10 @@ if (ENABLE_EGL AND ANDROID AND Waffle_FOUND)
retrace_common
glretrace_common
glproc_egl
- dl
${Waffle_LIBRARY}
+ ${X11_X11_LIB}
+ ${CMAKE_THREAD_LIBS_INIT}
+ dl
)
target_link_libraries (eglretrace ${proc_LIBRARY})
install (TARGETS eglretrace RUNTIME DESTINATION bin)
diff --git a/retrace/glws_waffle.cpp b/retrace/glws_waffle.cpp
index e959fb6b..3fcbe32f 100644
--- a/retrace/glws_waffle.cpp
+++ b/retrace/glws_waffle.cpp
@@ -95,7 +95,22 @@ init(void) {
i = 0;
waffle_init_attrib_list[i++] = WAFFLE_PLATFORM;
- waffle_init_attrib_list[i++] = WAFFLE_PLATFORM_ANDROID;
+ waffle_init_attrib_list[i++] =
+#if defined(__ANDROID__)
+ WAFFLE_PLATFORM_ANDROID
+#elif defined(__APPLE__)
+ WAFFLE_PLATFORM_CGL
+#elif defined(HAVE_X11)
+# if 1
+ WAFFLE_PLATFORM_GLX
+# else
+ WAFFLE_PLATFORM_X11_EGL
+# endif
+#else
+# warning Unsupported platform
+ WAFFLE_NONE
+#endif
+ ;
waffle_init_attrib_list[i++] = WAFFLE_NONE;
waffle_init(waffle_init_attrib_list);