aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindGLIB2.cmake
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2018-04-18 15:35:37 +0200
committerPeter Wu <peter@lekensteyn.nl>2018-04-19 08:08:11 +0000
commitb887fd49196b000b966e60ffc9913b4136a017d6 (patch)
tree1b9b7c32f2c0a25909949a9211c5cd8632717577 /cmake/modules/FindGLIB2.cmake
parentaae825cf7757b5fc2690f3ad95344c3d042b982b (diff)
CMake: fix build with json-glib with gold linker
JSON-GLIB depends on GObject. To avoid "undefined reference to 'g_object_unref'" with the gold linker, include gobject directly. As the files are included with the GLib package, adjust FindGLIB2.cmake. Change-Id: I007d30b89cc07d8746cee6b619832a722f086105 Fixes: v2.9.0rc0-201-g511c2e166a ("tshark: add -G elastic-mapping report.") Reviewed-on: https://code.wireshark.org/review/27007 Reviewed-by: Dario Lombardo <lomato@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'cmake/modules/FindGLIB2.cmake')
-rw-r--r--cmake/modules/FindGLIB2.cmake21
1 files changed, 20 insertions, 1 deletions
diff --git a/cmake/modules/FindGLIB2.cmake b/cmake/modules/FindGLIB2.cmake
index 4d0a2cfcd1..c6324fc240 100644
--- a/cmake/modules/FindGLIB2.cmake
+++ b/cmake/modules/FindGLIB2.cmake
@@ -71,6 +71,24 @@ find_library( GLIB2_LIBRARY
/usr/lib
)
+find_library(GOBJECT_LIBRARY
+ NAMES
+ gobject-2.0
+ gobject-2.0-0
+ HINTS
+ "${GLIB2_LIBDIR}"
+ "${GLIB2_HINTS}/lib"
+ PATHS
+ /opt/gnome/lib64
+ /opt/gnome/lib
+ /opt/lib/
+ /opt/local/lib
+ /sw/lib/
+ /usr/lib64
+ /usr/lib
+)
+
+
# search the glibconfig.h include dir under the same root where the library is found
get_filename_component( glib2LibDir "${GLIB2_LIBRARY}" PATH)
@@ -92,11 +110,12 @@ include( FindPackageHandleStandardArgs )
find_package_handle_standard_args( GLIB2
DEFAULT_MSG
GLIB2_LIBRARY
+ GOBJECT_LIBRARY
GLIB2_MAIN_INCLUDE_DIR
)
if( GLIB2_FOUND )
- set( GLIB2_LIBRARIES ${GLIB2_LIBRARY} )
+ set( GLIB2_LIBRARIES ${GLIB2_LIBRARY} ${GOBJECT_LIBRARY} )
set( GLIB2_INCLUDE_DIRS ${GLIB2_MAIN_INCLUDE_DIR} ${GLIB2_INTERNAL_INCLUDE_DIR} )
if ( WIN32 AND GLIB2_FOUND )
set ( GLIB2_DLL_DIR "${GLIB2_HINTS}/bin"