[Tizen] Support asan build option
authorJiyun Yang <ji.yang@samsung.com>
Wed, 6 Mar 2024 05:48:55 +0000 (14:48 +0900)
committerJiyun Yang <ji.yang@samsung.com>
Wed, 6 Mar 2024 06:06:00 +0000 (15:06 +0900)
This reverts commit b64b6b4389cad0b9661b36eb249ce9fe4bb9ab42.

Change-Id: Ib2d47732708daa66777cfb9c315cf0bcdf66f7f3

packaging/dali-csharp-binder.spec

index a4bc6eb..e43334f 100644 (file)
@@ -66,6 +66,13 @@ BuildRequires: pkgconfig(ecore-wl2)
 BuildRequires:  pkgconfig(ecore-wayland)
 %endif
 
+# For ASAN test
+%if "%{vd_asan}" == "1" || "%{asan}" == "1"
+BuildRequires: asan-force-options
+BuildRequires: asan-build-env
+BuildRequires: libasan
+%endif
+
 # for multiprofile
 Requires:   %{name}-compat = %{version}-%{release}
 Recommends: %{name}-profile_common = %{version}-%{release}
@@ -232,6 +239,12 @@ CXXFLAGS+=" -DOVER_TIZEN_VERSION_7"
 
 %endif
 
+%if "%{vd_asan}" == "1" || "%{asan}" == "1"
+CFLAGS+=" -fsanitize=address"
+CXXFLAGS+=" -fsanitize=address"
+LDFLAGS+=" -fsanitize=address"
+%endif
+
 %if 0%{?enable_debug}
 cmake_flags+=" -DCMAKE_BUILD_TYPE=Debug"
 %endif