From 293d25ed85720ff44859b5caac3e3dbc1ddda3f7 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 20 Aug 2022 03:33:04 +0300 Subject: [PATCH 45/45] Meson: Check if compiler supports '-Wno-nonnull-compare' Do not use the parameter, if the compiler does not support it. See osdn #45158 Signed-off-by: Marko Lindqvist --- meson.build | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index f1a2c3c273..9a910ee6ed 100644 --- a/meson.build +++ b/meson.build @@ -6,7 +6,11 @@ if not get_option('ack_experimental') 'Most scripts that do freeciv build with meson allow you to pass configure options\nvia environment variable EXTRA_CONFIG.') endif -add_global_arguments('-Wno-nonnull-compare', language : 'c') +c_compiler = meson.get_compiler('c') + +if c_compiler.has_argument('-Wno-nonnull-compare') + add_global_arguments('-Wno-nonnull-compare', language : 'c') +endif add_global_arguments('-fPIC', language : 'cpp') @@ -132,8 +136,6 @@ else server_binary_name = 'freeciv-server' endif -c_compiler = meson.get_compiler('c') - if meson.is_cross_build() cross_inc_str = meson.get_cross_property('cross_inc_path') cross_inc_path = [cross_inc_str] -- 2.35.1