[PATCH] meson.build: Skip C++ detection unless we're targeting Windows

Thomas Huth posted 1 patch 2 years, 5 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230705133639.146073-1-thuth@redhat.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Thomas Huth <thuth@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] meson.build: Skip C++ detection unless we're targeting Windows
Posted by Thomas Huth 2 years, 5 months ago
The only C++ code that we currently still have in the repository
is the code in qga/vss-win32/ - so we can skip the C++ detection
unless we are compiling binaries for Windows.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meson.build b/meson.build
index a9ba0bfab3..5559b36859 100644
--- a/meson.build
+++ b/meson.build
@@ -20,7 +20,7 @@ config_host = keyval.load(meson.current_build_dir() / 'config-host.mak')
 
 cc = meson.get_compiler('c')
 all_languages = ['c']
-if add_languages('cpp', required: false, native: false)
+if targetos == 'windows' and add_languages('cpp', required: false, native: false)
   all_languages += ['cpp']
   cxx = meson.get_compiler('cpp')
 endif
-- 
2.39.3
Re: [PATCH] meson.build: Skip C++ detection unless we're targeting Windows
Posted by Philippe Mathieu-Daudé 2 years, 5 months ago
On 5/7/23 15:36, Thomas Huth wrote:
> The only C++ code that we currently still have in the repository
> is the code in qga/vss-win32/ - so we can skip the C++ detection
> unless we are compiling binaries for Windows.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>   meson.build | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>