From 062da0a4bf0c85d77bbb966a75c81429d81c2308 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Wed, 15 Jan 2020 11:19:50 +0100 Subject: [PATCH] Use %%set_build_flags to export build flags if available --- cmake.spec | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/cmake.spec b/cmake.spec index a2bba06..a2f1e34 100644 --- a/cmake.spec +++ b/cmake.spec @@ -270,9 +270,15 @@ tail -n +2 %{SOURCE5} >> %{name}.req %build -export CFLAGS="%{optflags}" -export CXXFLAGS="%{optflags}" -export LDFLAGS="%{?__global_ldflags}" +%if 0%{?set_build_flags:1} +%{set_build_flags} +%else +CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS +CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS +FFLAGS="${FFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}}" ; export FFLAGS +FCFLAGS="${FCFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}}" ; export FCFLAGS +%{?__global_ldflags:LDFLAGS="${LDFLAGS:-%__global_ldflags}" ; export LDFLAGS ;} +%endif SRCDIR="$(/usr/bin/pwd)" mkdir %{_vpath_builddir} pushd %{_vpath_builddir} @@ -489,6 +495,7 @@ mv -f Modules/FindLibArchive.disabled Modules/FindLibArchive.cmake * Wed Jan 15 2020 Björn Esser - 3.16.2-1 - Update to 3.16.2 - Use %%_vpath_builddir for out-of-tree build +- Use %%set_build_flags to export build flags if available * Tue Jan 14 2020 Miro Hrončok - 3.16.1-2 - FindPython: Add support for version 3.9