From 450409095ab2dbe206b6b44be2426da46a487b53 Mon Sep 17 00:00:00 2001 From: Vitaly Zaitsev Date: Fri, 15 Mar 2019 20:14:54 +0100 Subject: [PATCH] Added Clang build support. Signed-off-by: Vitaly Zaitsev --- kepka.spec | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/kepka.spec b/kepka.spec index 183f8727e..6b7f270d6 100644 --- a/kepka.spec +++ b/kepka.spec @@ -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 ..