meson: Changed meson build to support address sanitizer build
authorSubhransu Mohanty <smohantty@gmail.com>
Tue, 21 Jan 2020 02:06:17 +0000 (02:06 +0000)
committerJongmin Lee <jm105.lee@samsung.com>
Wed, 20 May 2020 21:19:20 +0000 (06:19 +0900)
As we run some intermediate binary like edje_cc during efl build , and due to
those binary has some memory leaks the address sanitizer build of efl fails.
This Patch runs those binary with 'ASAN_OPTIONS=detect_leak=false' to disable the
memory leak check for those binaries.

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11137

src/bin/edje/meson.build
src/bin/elementary/meson.build

index f59b40f..12c26c3 100644 (file)
@@ -31,6 +31,11 @@ edje_cc = executable('edje_cc',
         pie:true, #TIZEN_ONLY
 )
 
+asan_option =[]
+if get_option('b_sanitize') == 'address'
+  asan_option= 'ASAN_OPTIONS=detect_leaks=0'
+endif
+
 if meson.is_cross_build()
   _edje_cc = find_program('edje_cc', native: true)
   edje_cc_path = _edje_cc.path()
@@ -41,7 +46,7 @@ else
     edje_cc_exe = [edje_cc.full_path()]
   else
     env = find_program('env', native: true)
-    edje_cc_exe = [env, 'EFL_RUN_IN_TREE=1', edje_cc.full_path()]
+    edje_cc_exe = [env, asan_option, 'EFL_RUN_IN_TREE=1', edje_cc.full_path()]
   endif
   edje_depends = [edje_cc, epp, evas_engine_buffer_mod, embryo_cc]
 endif
@@ -99,7 +104,7 @@ if meson.is_cross_build()
   edje_codegen_exe = [_edje_codegen]
 else
   env = find_program('env', native: true)
-  edje_codegen_exe = [env, 'EFL_RUN_IN_TREE=1', edje_codegen.full_path()]
+  edje_codegen_exe = [env, asan_option, 'EFL_RUN_IN_TREE=1', edje_codegen.full_path()]
 endif
 
 edje_pick = executable('edje_pick',
index 0f8d793..ef5d3de 100644 (file)
@@ -237,11 +237,16 @@ elementary_codegen = executable('elementary_codegen',
         link_args: link_args
 )
 
+asan_option =[]
+if get_option('b_sanitize') == 'address'
+  asan_option= 'ASAN_OPTIONS=detect_leaks=0'
+endif
+
 if meson.is_cross_build()
   elementary_codegen_exe = [find_program('elementary_codegen', native: true)]
 else
   env = find_program('env', native: true)
-  elementary_codegen_exe = [env, 'EFL_RUN_IN_TREE=1', elementary_codegen.full_path()]
+  elementary_codegen_exe = [env, asan_option, 'EFL_RUN_IN_TREE=1', elementary_codegen.full_path()]
 endif
 
 elm_prefs_cc_src = [
@@ -267,7 +272,7 @@ if meson.is_cross_build()
   elm_prefs_cc_exe = [_elm_prefs_cc]
 else
   env = find_program('env', native: true)
-  elm_prefs_cc_exe = [env, 'EFL_RUN_IN_TREE=1', elm_prefs_cc.full_path()]
+  elm_prefs_cc_exe = [env, asan_option, 'EFL_RUN_IN_TREE=1', elm_prefs_cc.full_path()]
 endif
 
 if sys_windows == false