From c5e85c94b449139347d0e9e88ef788e6eaedaa96 Mon Sep 17 00:00:00 2001 From: "sub.mohanty@samsung.com" Date: Sat, 15 Sep 2018 23:03:04 +0900 Subject: [PATCH] lottie/build: add sanitizer build to lottie-player library. Change-Id: I51d7d4b21bae19f4b6174ccb8f48ceefcc01f434 --- meson.build | 16 ++++++++++++++++ meson_options.txt | 18 ++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/meson.build b/meson.build index 9552d9b..a3315b5 100644 --- a/meson.build +++ b/meson.build @@ -8,6 +8,22 @@ add_global_arguments('-DDEMO_DIR="@0@/example/resource/"'.format(meson.current_s compiler_flags = ['-Wall', '-O2', '-std=c++14', '-fvisibility=hidden'] +if get_option('asan') == true + compiler_flags += ['-fsanitize=address'] + add_global_link_arguments('-fsanitize=address', language: 'cpp') +endif + +if get_option('msan') == true + compiler_flags += ['-fsanitize=memory'] + add_global_link_arguments('-fsanitize=memory', language: 'cpp') +endif + +if get_option('tsan') == true + compiler_flags += ['-fsanitize=thread'] + add_global_link_arguments('-fsanitize=thread', language: 'cpp') +endif + + if (build_machine.system() == 'linux') compiler_flags += ['-pthread'] add_global_link_arguments('-pthread', language: 'cpp') diff --git a/meson_options.txt b/meson_options.txt index d8e5890..c2c548f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -12,3 +12,21 @@ option('text', type: 'boolean', value: false, description: 'enable text module') + + +option('asan', + type: 'boolean', + value: false, + description: 'enable adress sanitizer') + + +option('msan', + type: 'boolean', + value: false, + description: 'enable memory sanitizer') + + +option('tsan', + type: 'boolean', + value: false, + description: 'enable thread sanitizer') -- 2.7.4