From 605ed458119b92392492984046ef9209d8a8bbb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= Date: Wed, 20 Sep 2023 17:15:40 +0200 Subject: [PATCH] =?UTF-8?q?Meson:=20add=20extra=20Fortran=20warnings=20onl?= =?UTF-8?q?y=20if=20warning=5Flevel=20=E2=A9=BE=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- meson.build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 137f9618c..26b70676f 100644 --- a/meson.build +++ b/meson.build @@ -2,6 +2,7 @@ # - Install files in right location # - configuration option to disable preprocessor build, and use it in {windows,macOS}/build.sh # - add -Wold-style-cast C++ flag except when building flex-generated files +# (only when warning_level ⩾ 2) # - add the possibility to customize the integration test names (with a new optional 'name' keyword in the dictionaries) # - Add an option to skip the removal of the temporary test directories, for debugging purposes # - See what to do with xvfb-run (see #1892). Maybe try to detect it from meson.build, and pass it optionally to the test driver script @@ -15,9 +16,12 @@ project('dynare', 'c_std=gnu17', 'warning_level=2' ], meson_version : '>=0.64.0') -add_global_arguments('-Wimplicit-interface', '-Wno-compare-reals', language : 'fortran') add_global_arguments('-DPACKAGE_VERSION="' + meson.project_version() + '"', language : 'cpp') +if get_option('warning_level').to_int() >= 2 + add_global_arguments('-Wimplicit-interface', '-Wno-compare-reals', language : 'fortran') +endif + cpp_compiler = meson.get_compiler('cpp') fortran_compiler = meson.get_compiler('fortran') c_compiler = meson.get_compiler('c')