]> git.cworth.org Git - apitrace/blobdiff - CMakeLists.txt
Remove duplicate pthread linkage.
[apitrace] / CMakeLists.txt
index 7090a34a21c4fde86b63aae73b03abd84d23f11c..f0ef513a5e562d9405791fee6f0c577ba8895587 100755 (executable)
@@ -268,6 +268,7 @@ add_library (common STATIC
     common/trace_file_snappy.cpp
     common/trace_model.cpp
     common/trace_parser.cpp
+    common/trace_parser_flags.cpp
     common/trace_writer.cpp
     common/trace_writer_local.cpp
     common/trace_writer_model.cpp
@@ -533,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})
+    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) 
@@ -561,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)