]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
meson: link libm
authorLaine Stump <laine@redhat.com>
Wed, 26 Aug 2020 18:22:07 +0000 (14:22 -0400)
committerLaine Stump <laine@redhat.com>
Tue, 1 Sep 2020 18:16:19 +0000 (14:16 -0400)
On some platforms libm (needed for the pow() function) isn't being
linked in somehow. This patch adds the necessary bits to assure that
it's linked in when necessary.

Suggested-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
(cherry picked from commit 20a62b42ec001310a6329d7ee2021f0737d534ef)

meson.build
src/util/meson.build

index e193166a9b65dfd4611777f494a8504cf08724e2..dc83804f854f41792508ef04c6600c1a32c96a25 100644 (file)
@@ -1176,6 +1176,9 @@ endif
 libxml_version = '2.9.1'
 libxml_dep = dependency('libxml-2.0', version: '>=' + libxml_version)
 
+cc = meson.get_compiler('c')
+m_dep = cc.find_library('m', required : false)
+
 use_macvtap = false
 if not get_option('macvtap').disabled()
   if (cc.has_header_symbol('linux/if_link.h', 'MACVLAN_MODE_BRIDGE') and
index a7017f459f666fe30d50e2c78270ee8e3f15d88a..f7092cc3f1644110c754adbafc45871df7c3b8b7 100644 (file)
@@ -188,6 +188,7 @@ virt_util_lib = static_library(
     devmapper_dep,
     gnutls_dep,
     libnl_dep,
+    m_dep,
     numactl_dep,
     secdriver_dep,
     src_dep,