Added Clang build support.

Signed-off-by: Vitaly Zaitsev <vitaly@easycoding.org>
This commit is contained in:
Vitaly Zaitsev 2019-03-15 20:14:54 +01:00 committed by Alex
parent 792a88d064
commit 450409095a
1 changed files with 21 additions and 0 deletions

View File

@ -1,3 +1,11 @@
# Allow to use Clang compiler...
%global clang 0
# Applying workaround to RHBZ#1559007...
%if 0%{?clang}
%global optflags %(echo %{optflags} | sed -e 's/-mcet//g' -e 's/-fcf-protection//g' -e 's/-fstack-clash-protection//g')
%endif
Name: kepka
Version: 2.0.0
Release: 1%{?dist}
@ -20,6 +28,13 @@ BuildRequires: gcc-c++
BuildRequires: cmake
BuildRequires: gcc
# Clang compiler and tools if enabled...
%if 0%{?clang}
BuildRequires: compiler-rt
BuildRequires: clang
BuildRequires: llvm
%endif
# Development packages for main application...
BuildRequires: guidelines-support-library-devel
BuildRequires: libappindicator-devel
@ -58,6 +73,12 @@ personal or business messaging needs.
mkdir -p %{_target_platform}
%build
# Overriding compiler settings...
%if 0%{?clang}
export CC=clang
export CXX=clang++
%endif
# Configuring application...
pushd %{_target_platform}
%cmake -G Ninja -DPACKAGED_BUILD=1 -DCMAKE_BUILD_TYPE=Release ..