lottie/build: add sanitizer build to lottie-player library. 90/189290/1
authorsub.mohanty@samsung.com <smohantty@gmail.com>
Sat, 15 Sep 2018 14:03:04 +0000 (23:03 +0900)
committersub.mohanty@samsung.com <smohantty@gmail.com>
Sat, 15 Sep 2018 14:03:04 +0000 (23:03 +0900)
Change-Id: I51d7d4b21bae19f4b6174ccb8f48ceefcc01f434

meson.build
meson_options.txt

index 9552d9b..a3315b5 100644 (file)
@@ -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')
index d8e5890..c2c548f 100644 (file)
@@ -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')