[Tizen] Support asan build option
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Tue, 27 Feb 2024 07:08:43 +0000 (16:08 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Tue, 27 Feb 2024 07:08:45 +0000 (16:08 +0900)
This reverts commit b15c5159e9562ee6199b2d0117aae667cc8846ba.

Change-Id: Iec8f50e44990fc16c094c95f9a898dc3f91e044d

packaging/dali-adaptor.spec

index 770f68b..24967e8 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