]> saetta.ns0.it Git - libzakutils/commitdiff
meson: better way to add math library dep.
authorAndrea Zagli <azagli@libero.it>
Tue, 30 Aug 2016 08:23:00 +0000 (10:23 +0200)
committerAndrea Zagli <azagli@libero.it>
Tue, 30 Aug 2016 08:23:00 +0000 (10:23 +0200)
meson.build
src/meson.build

index ccee548b48d14007cc974ca3c8ac0cc6df997372..9cb99ed71ca7e3920c30854a495df03ccd78c633 100644 (file)
@@ -1,12 +1,13 @@
 project('libzakutils', 'c',
         version: '0.0.1')
 
-add_global_link_arguments('-lm', language: 'c')
-
 glib_dep = dependency('glib-2.0')
 gobject_dep = dependency('gobject-2.0')
 gio_dep = dependency('gio-2.0')
 
+cc = meson.get_compiler('c')
+m_dep = cc.find_library('m', required : false)
+
 inc = include_directories('src')
 
 subdir('src')
index 031ec9a5ee3c97724a5db8d1aeebb6ab7615c6cf..381b1c214869fa5bbf865b0277f4731b85507635 100644 (file)
@@ -5,5 +5,5 @@ libzakutils_sources = ['datetime.c', 'generic.c']
 
 libzakutils = shared_library ('zakutils',
                               libzakutils_sources,
-                              dependencies: [glib_dep, gobject_dep, gio_dep],
+                              dependencies: [glib_dep, gobject_dep, gio_dep, m_dep],
                               install: true)
\ No newline at end of file