Merge "Add option to enable clang Asan build." into tizen submit/tizen/20180104.014647
authorwoongsuk cho <ws77.cho@samsung.com>
Tue, 2 Jan 2018 05:24:43 +0000 (05:24 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Tue, 2 Jan 2018 05:24:43 +0000 (05:24 +0000)
1  2 
packaging/dotnet-launcher.spec

@@@ -20,6 -20,11 +20,11 @@@ BuildRequires: pkgconfig(glib-2.0
  BuildRequires: aul-devel
  BuildRequires: dotnet-build-tools
  
+ %if 0%{?asan_enabled}
+ BuildRequires: clang >= 3.8
+ BuildRequires: compiler-rt
+ %endif
  Requires: aul
  Requires: launchpad
  
@@@ -52,8 -57,24 +57,24 @@@ Launchpad plugin for launching dotnet a
  %endif
  
  %build
+ %if 0%{?asan_enabled}
+ %define _dotnet_build_conf Debug
+ export CFLAGS=" --target=%{_host} "
+ export CXXFLAGS=" --target=%{_host} "
+ %ifarch %{ix86}
+ export CFLAGS=$(echo $CFLAGS | sed -e 's/--target=i686/--target=i586/')
+ export CXXFLAGS=$(echo $CXXFLAGS | sed -e 's/--target=i686/--target=i586/')
+ %endif
+ %endif
  cmake \
        -DCMAKE_INSTALL_PREFIX=%{_prefix} \
+ %if 0%{?asan_enabled}
+       -DCMAKE_C_COMPILER=clang \
+       -DCMAKE_CXX_COMPILER=clang++ \
+       -DASAN_ENABLED=TRUE \
+ %endif
        -DPACKAGE_NAME=%{name} \
        -DLIBDIR=%{_libdir} \
        -DBINDIR=%{_bindir} \
@@@ -99,5 -120,4 +120,5 @@@ ln -sf %{_libdir}/libsqlite3.so.0 %{bui
  %if %{use_managed_launcher}
  %{_bindir}/Tizen.Runtime.dll
  %endif
 -%caps(cap_sys_admin,cap_setgid=ei) %{_bindir}/dotnet-launcher
 +%{_bindir}/dotnet-launcher
 +