From 75e2bfb062d133df1675f56552dfb6ce06c2765a Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Mon, 29 Apr 2019 12:44:16 +0200 Subject: [PATCH] meson: Do not add compiler flags if 'plain' buildtype is used That is how the 'plain' buildtype is meant in meson. https://gitlab.gnome.org/GNOME/mutter/merge_requests/497 --- meson.build | 83 +++++++++++++++++++++++++++-------------------------- 1 file changed, 42 insertions(+), 41 deletions(-) diff --git a/meson.build b/meson.build index 961c47f8b..a804ff897 100644 --- a/meson.build +++ b/meson.build @@ -276,47 +276,48 @@ endforeach add_project_arguments('-D_GNU_SOURCE', language: 'c') -all_warnings = [ - '-fno-strict-aliasing', - '-Wpointer-arith', - '-Wmissing-declarations', - '-Wimplicit-function-declaration', - '-Wformat=2', - '-Wformat-nonliteral', - '-Wformat-security', - '-Wstrict-prototypes', - '-Wmissing-prototypes', - '-Wnested-externs', - '-Wold-style-definition', - '-Wundef', - '-Wunused', - '-Wcast-align', - '-Wmissing-noreturn', - '-Wmissing-format-attribute', - '-Wmissing-include-dirs', - '-Wlogical-op', - '-Wignored-qualifiers', - '-Werror=redundant-decls', - '-Werror=implicit', - '-Werror=nonnull', - '-Werror=init-self', - '-Werror=main', - '-Werror=missing-braces', - '-Werror=sequence-point', - '-Werror=return-type', - '-Werror=trigraphs', - '-Werror=array-bounds', - '-Werror=write-strings', - '-Werror=address', - '-Werror=int-to-pointer-cast', - '-Werror=pointer-to-int-cast', - '-Werror=empty-body', - '-Werror=write-strings', -] - -supported_warnings = cc.get_supported_arguments(all_warnings) - -add_project_arguments(supported_warnings, language: 'c') +buildtype = get_option('buildtype') +if buildtype != 'plain' + all_warnings = [ + '-fno-strict-aliasing', + '-Wpointer-arith', + '-Wmissing-declarations', + '-Wimplicit-function-declaration', + '-Wformat=2', + '-Wformat-nonliteral', + '-Wformat-security', + '-Wstrict-prototypes', + '-Wmissing-prototypes', + '-Wnested-externs', + '-Wold-style-definition', + '-Wundef', + '-Wunused', + '-Wcast-align', + '-Wmissing-noreturn', + '-Wmissing-format-attribute', + '-Wmissing-include-dirs', + '-Wlogical-op', + '-Wignored-qualifiers', + '-Werror=redundant-decls', + '-Werror=implicit', + '-Werror=nonnull', + '-Werror=init-self', + '-Werror=main', + '-Werror=missing-braces', + '-Werror=sequence-point', + '-Werror=return-type', + '-Werror=trigraphs', + '-Werror=array-bounds', + '-Werror=write-strings', + '-Werror=address', + '-Werror=int-to-pointer-cast', + '-Werror=pointer-to-int-cast', + '-Werror=empty-body', + '-Werror=write-strings', + ] + supported_warnings = cc.get_supported_arguments(all_warnings) + add_project_arguments(supported_warnings, language: 'c') +endif if get_option('debug') debug_c_args = [