diff options
author | José Fonseca <jose.r.fonseca@gmail.com> | 2011-12-05 09:53:28 +0000 |
---|---|---|
committer | José Fonseca <jose.r.fonseca@gmail.com> | 2011-12-05 09:53:59 +0000 |
commit | 2e08f33622bcb9e9da2e994da311fd44eeb62e6d (patch) | |
tree | 214c4d054317dcc112b4bd360c416df478622267 | |
parent | 8842c2353d673b45d34c163e444d6ecd068d255c (diff) |
Workaround weird issue with gdb and dlopen'ed libpthread.so
-rwxr-xr-x | CMakeLists.txt | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 710c626..fc331b6 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -534,14 +534,21 @@ target_link_libraries (glretrace ) if (WIN32) -elseif (APPLE) - target_link_libraries (glretrace - "-framework Cocoa" - "-framework ApplicationServices" # CGS* - ${OPENGL_gl_LIBRARY} # CGL* - ) else () - target_link_libraries (glretrace ${X11_X11_LIB}) + if (APPLE) + target_link_libraries (glretrace + "-framework Cocoa" + "-framework ApplicationServices" # CGS* + ${OPENGL_gl_LIBRARY} # CGL* + ) + else () + target_link_libraries (glretrace ${X11_X11_LIB} pthread) + endif () + + # gdb doesn't like when pthreads is loaded through dlopen (which happens + # when dlopen'ing libGL), so link pthreads to avoid this issue. See also + # http://stackoverflow.com/questions/2702628/gdb-cannot-find-new-threads-generic-error + target_link_libraries (glretrace pthread) endif () install (TARGETS glretrace RUNTIME DESTINATION bin) @@ -562,10 +569,8 @@ if (EGL_FOUND AND NOT WIN32 AND NOT APPLE) target_link_libraries (eglretrace common - ) - - target_link_libraries (eglretrace ${X11_X11_LIB} + pthread ) install (TARGETS eglretrace RUNTIME DESTINATION bin) |