]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Auth/meson: Don't fail if compiler doesn't support trivial-auto-var-init 14278/head
authorFred Morcos <fred.morcos@open-xchange.com>
Tue, 4 Jun 2024 11:42:53 +0000 (13:42 +0200)
committerFred Morcos <fred.morcos@open-xchange.com>
Tue, 4 Jun 2024 11:45:24 +0000 (13:45 +0200)
meson/auto-var-init/meson.build

index 1d528437eafc8b2448d245536d1b740b72c3bdaf..56c3ade41fccc3f4e5b28b1e49839743c36a7b43 100644 (file)
@@ -2,12 +2,12 @@ auto_var_init = get_option('auto-var-init')
 
 if auto_var_init != 'disabled'
   arg = '-ftrivial-auto-var-init=' + auto_var_init
-  if not cxx.has_argument(arg)
-    error('Compiler does not support ' + arg + ', which is needed for automatic variable initialization')
-    subdir_done()
+  if cxx.has_argument(arg)
+    add_project_arguments(arg, language: ['c', 'cpp'])
+  else
+    warning('Compiler does not support ' + arg + ', which is needed for automatic variable initialization')
+    auto_var_init = 'unsupported by compiler'
   endif
-
-  add_project_arguments(arg, language: ['c', 'cpp'])
 endif
 
 summary('Auto Var Init', auto_var_init, section: 'Configuration')