[Tizen] Support asan build option
authorBowon Ryu <bowon.ryu@samsung.com>
Tue, 26 Nov 2024 07:57:44 +0000 (16:57 +0900)
committerBowon Ryu <bowon.ryu@samsung.com>
Tue, 26 Nov 2024 07:57:44 +0000 (16:57 +0900)
This reverts commit db67bac984fc08b03f25508090692c199be36a2a.

packaging/dali.spec

index e3bf9595ae9dd8d8bf55eafe0376dba3e53e729f..6b1f953d8b375853ee9a3b04540b9d648e49dc01 100644 (file)
@@ -17,6 +17,13 @@ BuildRequires:  gawk
 BuildRequires:  pkgconfig(libtzplatform-config)
 %endif
 
+# For ASAN test
+%if "%{vd_asan}" == "1" || "%{asan}" == "1"
+BuildRequires: asan-force-options
+BuildRequires: asan-build-env
+BuildRequires: libasan
+%endif
+
 %description
 DALi 3D Engine
 
@@ -71,9 +78,18 @@ LDFLAGS+=" --coverage "
 libtoolize --force
 cd %{_builddir}/%{name}-%{version}/build/tizen
 
-CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS;
-CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS;
-LDFLAGS="${LDFLAGS:-%optflags}" ; export LDFLAGS;
+CFLAGS="${CFLAGS:-%optflags}" ;
+CXXFLAGS="${CXXFLAGS:-%optflags}" ;
+LDFLAGS="${LDFLAGS:-%optflags}" ;
+
+%if "%{vd_asan}" == "1" || "%{asan}" == "1"
+CFLAGS+=" -fsanitize=address"
+CXXFLAGS+=" -fsanitize=address"
+LDFLAGS+=" -fsanitize=address"
+%endif
+export CFLAGS;
+export CXXFLAGS;
+export LDFLAGS;
 
 cmake \
 %if 0%{?enable_debug}