From 519fc5260246019e0b7c33b8e3706bb9f3d1688d Mon Sep 17 00:00:00 2001 From: sulincix Date: Tue, 19 Nov 2024 21:10:20 +0000 Subject: [PATCH] disable optimize options added --- meson.build | 26 ++++++++++++++------------ meson_options.txt | 1 + 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/meson.build b/meson.build index e9d6ff3..7e1457e 100755 --- a/meson.build +++ b/meson.build @@ -24,30 +24,32 @@ run_command('bash', './tool/mkctx.sh', run_command('bash', './tool/check.sh', meson.current_build_dir(), check:true) cflags = ['-I'+meson.current_source_dir()/'src/include/'] ldflags = ['-L'+meson.current_build_dir(), '-lymp'] -cflags += ['-std=c99'] if get_option('ansi') cflags += ['-ansi'] endif -# disable vala related warnings -cflags += ['-Wno-unused', '-Wno-unused-result', '-Wno-incompatible-pointer-types', +cflags += ['-DGETTEXT_PACKAGE=ymp'] + +if get_option('optimize') + # disable vala related warnings + cflags += ['-Wno-unused', '-Wno-unused-result', '-Wno-incompatible-pointer-types', '-Wno-discarded-qualifiers', '-Wno-infinite-recursion', '-Wno-cast-function-type', '-Wno-attributes','-Wno-unknown-warning-option', - ] + ] -cflags += ['-DGETTEXT_PACKAGE=ymp'] -# some compiler flags from dpkg-buildpackage -cflags += ['-g', '-O2', '-Werror=implicit-function-declaration', + # some compiler flags from dpkg-buildpackage + cflags += ['-g', '-O2', '-Werror=implicit-function-declaration', '-ffile-prefix-map=/root/ymp=.', '-fstack-protector-strong', '-fstack-clash-protection', '-Wformat', '-Werror=format-security' - ] + ] -# error on warning -if compiler.get_id() == 'gcc' - cflags += ['-Werror'] -endif + # error on warning + if compiler.get_id() == 'gcc' + cflags += ['-Werror'] + endif +endif # some improvements cflags += ['-fno-plt', '-flto', '-isystem', '-fvisibility=hidden', '-DVALA_EXTERN=extern', '-pthread'] diff --git a/meson_options.txt b/meson_options.txt index 9ac9505..0e509a0 100755 --- a/meson_options.txt +++ b/meson_options.txt @@ -2,6 +2,7 @@ option('static', type: 'boolean', value: false) option('locale', type: 'boolean', value: true) option('experimental', type: 'boolean', value: false) option('ansi', type: 'boolean', value: true) +option('optimize', type: 'boolean', value: true) option('test', type: 'boolean', value: false) option('doc', type: 'boolean', value: false) option('tools', type: 'boolean', value: true)