add debug mode support
This commit is contained in:
parent
4a3cc010b0
commit
c3cbbda2a0
7 changed files with 92 additions and 6 deletions
11
meson.build
11
meson.build
|
|
@ -1,11 +1,18 @@
|
|||
project('tutorial', 'cpp')
|
||||
|
||||
CC = meson.get_compiler('cpp')
|
||||
target_name = 'main'
|
||||
|
||||
zlib = dependency('zlib', version : '1.2.11', static: true, required: true)
|
||||
|
||||
target_name = 'main'
|
||||
|
||||
files = files('src/main.cpp')
|
||||
|
||||
if get_option('buildtype') == 'debug'
|
||||
if CC.has_argument('-fsanitize=address') and CC.has_link_argument('-fsanitize=address')
|
||||
add_project_arguments('-fsanitize=address', '-fno-omit-frame-pointer', language: 'cpp')
|
||||
add_project_link_arguments('-fsanitize=address', language: 'cpp')
|
||||
endif
|
||||
add_project_arguments('-DDEBUG', language: 'cpp')
|
||||
endif
|
||||
|
||||
executable(target_name, files, dependencies: [zlib], include_directories: include_directories('src/include'))
|
||||
Loading…
Add table
Add a link
Reference in a new issue