diff --git a/meson.build b/meson.build index 9559f0793c..ccec712295 100644 --- a/meson.build +++ b/meson.build @@ -67,8 +67,6 @@ libnm_version = '@0@.@1@.@2@'.format(current - age, age, revision) libnm_pkgincludedir = join_paths(nm_includedir, libnm_name) -nm_debug = get_option('buildtype').contains('debug') - gnome = import('gnome') i18n = import('i18n') pkg = import('pkgconfig') @@ -175,67 +173,64 @@ if enable_lto common_ldflags += lto_flag endif -if nm_debug - common_flags += cc.get_supported_arguments([ - '-Wall', - '-Wextra', - '-Wdeclaration-after-statement', - '-Wfloat-equal', - '-Wformat-nonliteral', - '-Wformat-security', - '-Wimplicit-function-declaration', - '-Winit-self', - '-Wlogical-op', - '-Wmissing-declarations', - '-Wmissing-include-dirs', - '-Wmissing-prototypes', - '-Wpointer-arith', - '-Wshadow', - '-Wshift-negative-value', - '-Wstrict-prototypes', - '-Wundef', - '-Wvla', - '-Wno-duplicate-decl-specifier', - '-Wno-format-truncation', - '-Wno-format-y2k', - '-Wno-gnu-variable-sized-type-not-at-end', - '-Wno-missing-field-initializers', - '-Wno-pragmas', - '-Wno-sign-compare', - '-Wno-tautological-constant-out-of-range-compare', - '-Wno-unknown-pragmas', - '-Wno-unused-parameter', - '-Wparentheses-equality', - '-Wpointer-arith', - '-Wshadow', - '-Wstrict-prototypes', - '-Wtypedef-redefinition', - '-Wundef', - '-Wunknown-attributes', - '-fno-strict-aliasing', - ]) +common_flags += cc.get_supported_arguments([ + '-Wall', + '-Wextra', + '-Wdeclaration-after-statement', + '-Wfloat-equal', + '-Wformat-nonliteral', + '-Wformat-security', + '-Wimplicit-function-declaration', + '-Winit-self', + '-Wlogical-op', + '-Wmissing-declarations', + '-Wmissing-include-dirs', + '-Wmissing-prototypes', + '-Wpointer-arith', + '-Wshadow', + '-Wshift-negative-value', + '-Wstrict-prototypes', + '-Wundef', + '-Wvla', + '-Wno-duplicate-decl-specifier', + '-Wno-format-truncation', + '-Wno-format-y2k', + '-Wno-gnu-variable-sized-type-not-at-end', + '-Wno-missing-field-initializers', + '-Wno-pragmas', + '-Wno-sign-compare', + '-Wno-tautological-constant-out-of-range-compare', + '-Wno-unknown-pragmas', + '-Wno-unused-parameter', + '-Wparentheses-equality', + '-Wpointer-arith', + '-Wshadow', + '-Wstrict-prototypes', + '-Wtypedef-redefinition', + '-Wundef', + '-Wunknown-attributes', + '-fno-strict-aliasing', +]) - if cc.has_argument('-Wimplicit-fallthrough') - if cc.compiles(''' - int main(int argc, char **argv) { - int r = 0; - switch (argc) { - case 0: - r++; - /* fall-through */ - case 1: - r++; - break; - } - return r; - } - ''', - args: '-Werror=implicit-fallthrough', - name: '-Werror=implicit-fallthrough') - common_flags += '-Wimplicit-fallthrough' - endif +if cc.has_argument('-Wimplicit-fallthrough') + if cc.compiles(''' + int main(int argc, char **argv) { + int r = 0; + switch (argc) { + case 0: + r++; + /* fall-through */ + case 1: + r++; + break; + } + return r; + } + ''', + args: '-Werror=implicit-fallthrough', + name: '-Werror=implicit-fallthrough') + common_flags += '-Wimplicit-fallthrough' endif - endif add_project_arguments(common_flags, language: 'c')