[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/10] meson: perform snappy test with the C++ compiler if used
From: |
Paolo Bonzini |
Subject: |
[PULL 04/10] meson: perform snappy test with the C++ compiler if used |
Date: |
Mon, 8 Nov 2021 15:36:10 +0100 |
Snappy is written in C++ and as such needs to link against libstdc++. When
linking statically, this means that the compile test cannot succeed unless
performed with a C++ compiler. Do so if link_language is set to C++; if it
is C, the test will usually fail and snappy will be disabled.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
meson.build | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index 47df10afc2..6bfed294d0 100644
--- a/meson.build
+++ b/meson.build
@@ -197,6 +197,10 @@ add_project_arguments('-iquote', '.',
link_language = meson.get_external_property('link_language', 'cpp')
if link_language == 'cpp'
add_languages('cpp', required: true, native: false)
+ cxx = meson.get_compiler('cpp')
+ linker = cxx
+else
+ linker = cc
endif
if host_machine.system() == 'darwin'
add_languages('objc', required: false, native: false)
@@ -1109,7 +1113,7 @@ if not get_option('snappy').auto() or have_system
required: get_option('snappy'),
kwargs: static_kwargs)
endif
-if snappy.found() and not cc.links('''
+if snappy.found() and not linker.links('''
#include <snappy-c.h>
int main(void) { snappy_max_compressed_length(4096); return 0; }''',
dependencies: snappy)
snappy = not_found
--
2.33.1
- [PULL 00/10] Misc QEMU bugfixes for 6.2 hard freeze, Paolo Bonzini, 2021/11/08
- [PULL 01/10] target-i386: mmu: use pg_mode instead of HF_LMA_MASK, Paolo Bonzini, 2021/11/08
- [PULL 06/10] configure: simplify calls to meson_quote, Paolo Bonzini, 2021/11/08
- [PULL 08/10] configure: propagate --extra-cflags and --extra-ldflags to meson compile tests, Paolo Bonzini, 2021/11/08
- [PULL 02/10] target-i386: mmu: fix handling of noncanonical virtual addresses, Paolo Bonzini, 2021/11/08
- [PULL 04/10] meson: perform snappy test with the C++ compiler if used,
Paolo Bonzini <=
- [PULL 07/10] configure: preserve CFLAGS, CXXFLAGS and LDFLAGS in config.status, Paolo Bonzini, 2021/11/08
- [PULL 03/10] hw/scsi/scsi-disk: MODE_PAGE_ALLS not allowed in MODE SELECT commands, Paolo Bonzini, 2021/11/08
- [PULL 09/10] configure: ignore preexisting QEMU_*FLAGS envvars, Paolo Bonzini, 2021/11/08
- [PULL 10/10] ui/gtk-egl: Fix build failure when libgbm is not available, Paolo Bonzini, 2021/11/08
- [PULL 05/10] docs: adjust for demise of scripts/create_config, Paolo Bonzini, 2021/11/08
- Re: [PULL 00/10] Misc QEMU bugfixes for 6.2 hard freeze, Richard Henderson, 2021/11/08