Skip to content

Commit

Permalink
disable optimize options added
Browse files Browse the repository at this point in the history
  • Loading branch information
sulincix committed Nov 19, 2024
1 parent 18ebaf5 commit 519fc52
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
26 changes: 14 additions & 12 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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']

Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 519fc52

Please sign in to comment.