[gnome-2048/wip/jtojnar/libm] build: depend on libm



commit d784dbe7f2a8bf7e894d1ebdff802412cf3bcc7d
Author: Jan Tojnar <jtojnar gmail com>
Date:   Tue Jan 8 16:58:27 2019 +0100

    build: depend on libm
    
    On Ubuntu, the linking fails without libm:
    
            /usr/bin/ld: src/25a6634@@gnome-2048@exe/meson-generated_view.c.o: undefined reference to symbol 
'ceilf@@GLIBC_2.2.5'
            /usr/bin/ld: //lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
            collect2: error: ld returned 1 exit status

 meson.build     | 2 ++
 src/meson.build | 1 +
 2 files changed, 3 insertions(+)
---
diff --git a/meson.build b/meson.build
index d236fbd..211b03f 100644
--- a/meson.build
+++ b/meson.build
@@ -8,6 +8,7 @@ project(
 gnome = import('gnome')
 i18n = import('i18n')
 
+cc = meson.get_compiler('c')
 valac = meson.get_compiler('vala')
 
 # Paths
@@ -20,6 +21,7 @@ podir = join_paths(meson.current_source_dir(), 'po')
 
 # Dependencies
 posix = valac.find_library('posix')
+libm = cc.find_library('m', required: false) # some platforms do not have libm separated from libc
 gtk = dependency('gtk+-3.0', version: '>= 3.12.0')
 clutter = dependency('clutter-1.0', version: '>= 1.12.0')
 clutter_gtk = dependency('clutter-gtk-1.0', version: '>= 1.6.0')
diff --git a/src/meson.build b/src/meson.build
index 3b8dd2b..e9a4411 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -18,6 +18,7 @@ gnome_2048 = executable(
   gnome_2048_sources,
   dependencies: [
     posix,
+    libm,
     gtk,
     clutter,
     clutter_gtk,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]