diff options
author | Paolo Bonzini | 2021-01-26 11:20:35 +0100 |
---|---|---|
committer | Paolo Bonzini | 2021-02-08 14:43:54 +0100 |
commit | c518d6c2bffdef9d98177dba7f25d5cb4193822e (patch) | |
tree | cdbd49c96657ded09fa03e14a25fe956b09345e0 | |
parent | meson: accept either shared or static libraries if --disable-static (diff) | |
download | qemu-c518d6c2bffdef9d98177dba7f25d5cb4193822e.tar.gz qemu-c518d6c2bffdef9d98177dba7f25d5cb4193822e.tar.xz qemu-c518d6c2bffdef9d98177dba7f25d5cb4193822e.zip |
meson: honor --enable-rbd if cc.links test fails
If the link test failed, compilation proceeded with RBD disabled,
even if --enable-rbd was used on the configure command line.
Fix that.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | meson.build | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/meson.build b/meson.build index 6d6537d74a..5bd22f431a 100644 --- a/meson.build +++ b/meson.build @@ -690,15 +690,21 @@ if not get_option('rbd').auto() or have_block librbd = cc.find_library('rbd', has_headers: ['rbd/librbd.h'], required: get_option('rbd'), kwargs: static_kwargs) - if librados.found() and librbd.found() and cc.links(''' - #include <stdio.h> - #include <rbd/librbd.h> - int main(void) { - rados_t cluster; - rados_create(&cluster, NULL); - return 0; - }''', dependencies: [librbd, librados]) - rbd = declare_dependency(dependencies: [librbd, librados]) + if librados.found() and librbd.found() + if cc.links(''' + #include <stdio.h> + #include <rbd/librbd.h> + int main(void) { + rados_t cluster; + rados_create(&cluster, NULL); + return 0; + }''', dependencies: [librbd, librados]) + rbd = declare_dependency(dependencies: [librbd, librados]) + elif get_option('rbd').enabled() + error('could not link librados') + else + warning('could not link librados, disabling') + endif endif endif |