meson: store dependency('threads') in a variable
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 3 Jun 2021 13:01:35 +0000 (15:01 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 6 Jul 2021 06:33:51 +0000 (08:33 +0200)
It can be useful for has_function checks.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
meson.build
util/meson.build

index 53dfc2b4c6ad74be6df8b6d33c15cc7d63e72528..e288e4c21c1a60487979e5b539b7961df755c4fe 100644 (file)
@@ -164,6 +164,7 @@ endif
 multiprocess_allowed = targetos == 'linux' and not get_option('multiprocess').disabled()
 
 libm = cc.find_library('m', required: false)
+threads = dependency('threads')
 util = cc.find_library('util', required: false)
 winmm = []
 socket = []
@@ -1999,7 +2000,7 @@ util_ss.add_all(trace_ss)
 util_ss = util_ss.apply(config_all, strict: false)
 libqemuutil = static_library('qemuutil',
                              sources: util_ss.sources() + stub_ss.sources() + genh,
-                             dependencies: [util_ss.dependencies(), libm, glib, socket, malloc, pixman])
+                             dependencies: [util_ss.dependencies(), libm, threads, glib, socket, malloc, pixman])
 qemuutil = declare_dependency(link_with: libqemuutil,
                               sources: genh + version_res)
 
index 97fad4410544f85cfd394ba4e222b86abfca546d..6af05a5716ddbde3cb93555a1a4fa002c0fe7e53 100644 (file)
@@ -1,4 +1,3 @@
-util_ss.add(dependency('threads'))
 util_ss.add(files('osdep.c', 'cutils.c', 'unicode.c', 'qemu-timer-common.c'))
 util_ss.add(when: 'CONFIG_ATOMIC64', if_false: files('atomic64.c'))
 util_ss.add(when: 'CONFIG_POSIX', if_true: files('aio-posix.c'))