Index: meson.build |
=================================================================== |
--- a/meson.build |
+++ b/meson.build |
@@ -1,16 +1,17 @@ |
project('adblockpluscore', 'cpp', license: ['GPL3'], meson_version: '>0.40.0') |
native = get_option('native') |
if native |
target_type='native' |
else |
target_type='js' |
endif |
+asan = get_option('asan') |
if target_type == 'js' |
# locate emscripten-config |
python = import('python3').find_python() |
emscripten_config = get_option('emscripten-config') |
command = run_command(python, '-c', 'import os.path, sys;print(os.path.expanduser(sys.argv[1]))', emscripten_config) |
if command.returncode() != 0 |
error(command.stderr().strip()) |
@@ -51,17 +52,19 @@ |
endif |
if target_type == 'js' |
# CXXFLAGS specific to emcc |
ADDITIONAL_PARAMS += [ '-m32', '--memory-init-file', '0', |
'--emit-symbol-map' ] |
else |
if cpp_compiler_id != 'msvc' |
- ADDITIONAL_PARAMS += [ '-fsanitize=address' ] |
+ if asan |
+ ADDITIONAL_PARAMS += [ '-fsanitize=address' ] |
+ endif |
endif |
endif |
# additional params just for core |
CORE_PARAMS = [] |
if cpp_compiler_id != 'msvc' |
CORE_PARAMS += [ '-fno-exceptions' ] |
endif |
@@ -131,18 +134,20 @@ |
optional_args = [] |
buildtype = get_option('buildtype') |
if buildtype.startswith('debug') |
if cpp_compiler_id != 'msvc' |
optional_args += '-DDEBUG' |
optional_args += '-g3' |
if target_type == 'native' |
- ADDITIONAL_PARAMS += [ '-fsanitize=address' ] |
- LINK_PARAMS += [ '-fsanitize=address' ] |
+ if asan |
+ ADDITIONAL_PARAMS += [ '-fsanitize=address' ] |
+ LINK_PARAMS += [ '-fsanitize=address' ] |
+ endif |
endif |
endif |
endif |
tracing = get_option('tracing') |
if tracing |
optional_args += '--tracing' |
endif |