From 084ff3c55cce8bcba7099565b334fa4c88fd9df7 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 20 Oct 2020 16:50:55 +0300 Subject: meson: fix build with thread support Signed-off-by: Tomi Valkeinen --- kms++util/meson.build | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'kms++util') diff --git a/kms++util/meson.build b/kms++util/meson.build index f9e76ae..4105db6 100644 --- a/kms++util/meson.build +++ b/kms++util/meson.build @@ -26,13 +26,22 @@ public_headers = [ private_includes = include_directories('src', 'inc') public_includes = include_directories('inc') -libkmsxxutil_deps = [ libkmsxx_dep, libfmt_dep ] +thread_dep = dependency('threads', required : false) + +libkmsxxutil_args = [ ] + +if thread_dep.found() + libkmsxxutil_args += [ '-DHAS_PTHREAD' ] +endif + +libkmsxxutil_deps = [ libkmsxx_dep, libfmt_dep, thread_dep ] libkmsxxutil = library('kms++util', libkmsxxutil_sources, install : true, include_directories : private_includes, - dependencies : libkmsxxutil_deps) + dependencies : libkmsxxutil_deps, + cpp_args : libkmsxxutil_args) libkmsxxutil_dep = declare_dependency(include_directories : public_includes, link_with : libkmsxxutil) -- cgit v1.2.3