mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-26 11:12:58 +00:00
added asan for debug builds
This commit is contained in:
parent
6753364573
commit
81e9256b7a
18
meson.build
18
meson.build
|
|
@ -12,6 +12,9 @@ pymod = import('python')
|
|||
python = pymod.find_installation('python3', required: true)
|
||||
|
||||
cc = meson.get_compiler('cpp')
|
||||
buildtype = get_option('buildtype')
|
||||
#langs cant sadly be set before calling project
|
||||
langs = ['cpp', 'c']
|
||||
|
||||
# system deps
|
||||
gl_dep = dependency('gl')
|
||||
|
|
@ -21,6 +24,19 @@ png_dep = dependency('libpng')
|
|||
thread_dep = dependency('threads')
|
||||
dl_dep = cc.find_library('dl')
|
||||
|
||||
if buildtype.startswith('debug')
|
||||
strAsan = '-fsanitize=address'
|
||||
strLsan = '-fsanitize=leak'
|
||||
if cc.has_argument(strAsan)
|
||||
add_project_arguments(strAsan, language: langs)
|
||||
add_project_link_arguments(strAsan, language: langs)
|
||||
endif
|
||||
if cc.has_argument(strLsan)
|
||||
add_project_arguments(strLsan, language: langs)
|
||||
add_project_link_arguments(strLsan, language: langs)
|
||||
endif
|
||||
endif
|
||||
|
||||
# compile flags (chagne ts juicey)
|
||||
global_cpp_args = [
|
||||
'-fpermissive',
|
||||
|
|
@ -52,4 +68,4 @@ subdir('4J.Profile')
|
|||
subdir('4J.Storage')
|
||||
subdir('Minecraft.Assets')
|
||||
subdir('Minecraft.World')
|
||||
subdir('Minecraft.Client')
|
||||
subdir('Minecraft.Client')
|
||||
|
|
|
|||
Loading…
Reference in a new issue