mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2025-11-25 06:59:50 -05:00
feat: make asan as the debug type feature
This commit is contained in:
parent
432067d9a2
commit
f0576cb40a
2 changed files with 22 additions and 5 deletions
26
meson.build
26
meson.build
|
|
@ -1,5 +1,5 @@
|
||||||
project('maomao', ['c', 'cpp'],
|
project('mango', ['c', 'cpp'],
|
||||||
version : '0.7.3' # 这个版本号将被 Git tag 覆盖
|
version : '0.8.1',
|
||||||
)
|
)
|
||||||
|
|
||||||
subdir('protocols')
|
subdir('protocols')
|
||||||
|
|
@ -59,14 +59,29 @@ c_args = [
|
||||||
'-Wno-unused-function',
|
'-Wno-unused-function',
|
||||||
'-DWLR_USE_UNSTABLE',
|
'-DWLR_USE_UNSTABLE',
|
||||||
'-D_POSIX_C_SOURCE=200809L',
|
'-D_POSIX_C_SOURCE=200809L',
|
||||||
'-DVERSION="@0@"'.format(version_with_hash), # 版本信息包含 Commit Hash 和最新的 tag
|
'-DVERSION="@0@"'.format(version_with_hash),
|
||||||
'-DSYSCONFDIR="@0@"'.format('/etc'), # 添加 sysconfdir
|
'-DSYSCONFDIR="@0@"'.format('/etc'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# 仅在 debug 选项启用时添加调试参数
|
||||||
|
if get_option('asan')
|
||||||
|
c_args += [
|
||||||
|
'-fsanitize=address',
|
||||||
|
'-fno-omit-frame-pointer',
|
||||||
|
'-fno-optimize-sibling-calls'
|
||||||
|
]
|
||||||
|
endif
|
||||||
|
|
||||||
if xcb.found() and xlibs.found()
|
if xcb.found() and xlibs.found()
|
||||||
c_args += '-DXWAYLAND'
|
c_args += '-DXWAYLAND'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# 链接参数(根据 debug 状态添加 ASAN)
|
||||||
|
link_args = []
|
||||||
|
if get_option('asan')
|
||||||
|
link_args += '-fsanitize=address'
|
||||||
|
endif
|
||||||
|
|
||||||
executable('mango',
|
executable('mango',
|
||||||
'src/mango.c',
|
'src/mango.c',
|
||||||
'src/common/util.c',
|
'src/common/util.c',
|
||||||
|
|
@ -83,7 +98,8 @@ executable('mango',
|
||||||
pcre2_dep,
|
pcre2_dep,
|
||||||
],
|
],
|
||||||
install : true,
|
install : true,
|
||||||
c_args : c_args
|
c_args : c_args,
|
||||||
|
link_args : link_args,
|
||||||
)
|
)
|
||||||
|
|
||||||
desktop_install_dir = join_paths(prefix, 'share/wayland-sessions')
|
desktop_install_dir = join_paths(prefix, 'share/wayland-sessions')
|
||||||
|
|
|
||||||
|
|
@ -1 +1,2 @@
|
||||||
option('xwayland', type : 'feature', value : 'enabled')
|
option('xwayland', type : 'feature', value : 'enabled')
|
||||||
|
option('asan', type : 'boolean', value : false)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue