From 5bbe713ca55c56ddab706472a52dcb2c7be89d6e Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Wed, 23 Jun 2021 11:47:59 +0900 Subject: [PATCH] infra: add memory sanitize option in meson for optimial library, we removed some peripheral information in default, this breaks asan environment. This patch changes it to make it both. if you want to use asan, please change the meson option. default is disabled. example) $meson . build -Db_sanitize=address $meson . build -Db_sanitize=address,undefined --- meson.build | 2 +- src/meson.build | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 69f41cfc..cb3b0b0b 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project('thorvg', 'cpp', - default_options : ['buildtype=debugoptimized', 'werror=false', 'optimization=s'], + default_options : ['buildtype=debugoptimized', 'b_sanitize=none', 'werror=false', 'optimization=s'], version : '0.2.99', license : 'MIT') diff --git a/src/meson.build b/src/meson.build index 7e19d039..2e237e49 100644 --- a/src/meson.build +++ b/src/meson.build @@ -6,9 +6,11 @@ if (cc.get_id() != 'msvc') compiler_flags += ['-mavx'] message('Enable Advanced Vector Extension') endif - compiler_flags += ['-fno-exceptions', '-fno-rtti', - '-fno-unwind-tables' , '-fno-asynchronous-unwind-tables', - '-Woverloaded-virtual', '-Wno-unused-parameter'] + if get_option('b_sanitize') == 'none' + compiler_flags += ['-fno-exceptions', '-fno-rtti', + '-fno-unwind-tables' , '-fno-asynchronous-unwind-tables', + '-Woverloaded-virtual', '-Wno-unused-parameter'] + endif endif