[Tizen] Support asan build option
authorEverLEEst(SangHyeon Lee) <sh10233.lee@samsung.com>
Wed, 20 Mar 2024 09:38:44 +0000 (18:38 +0900)
committerEverLEEst(SangHyeon Lee) <sh10233.lee@samsung.com>
Wed, 20 Mar 2024 09:38:44 +0000 (18:38 +0900)
This reverts commit 20b0b3e19e7ac95b8ad8b23ec9ccb83de0428784.

packaging/dali-adaptor.spec

index efa1c72..5b6cabe 100644 (file)
@@ -117,6 +117,13 @@ BuildRequires:  pkgconfig(component-based-core-base)
 BuildRequires:  pkgconfig(thorvg)
 %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}
@@ -298,6 +305,12 @@ CXXFLAGS+=" -DOVER_TIZEN_VERSION_7"
 CXXFLAGS+=" -DOVER_TIZEN_VERSION_8"
 %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