From 202d11b3d1ff7d24c12f80bf0d8f14e72881bab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Wed, 15 Jan 2020 11:40:16 +0100 Subject: [PATCH] Use %%set_build_flags inside macros.cmake if available --- cmake.spec | 1 + macros.cmake | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/cmake.spec b/cmake.spec index a2f1e34..7055ac2 100644 --- a/cmake.spec +++ b/cmake.spec @@ -496,6 +496,7 @@ mv -f Modules/FindLibArchive.disabled Modules/FindLibArchive.cmake - Update to 3.16.2 - Use %%_vpath_builddir for out-of-tree build - Use %%set_build_flags to export build flags if available +- Use %%set_build_flags inside macros.cmake if available * Tue Jan 14 2020 Miro HronĨok - 3.16.1-2 - FindPython: Add support for version 3.9 diff --git a/macros.cmake b/macros.cmake index 572d3e4..7f24b69 100644 --- a/macros.cmake +++ b/macros.cmake @@ -14,11 +14,15 @@ # - Set default install prefixes and library install directories # - Turn on shared libraries by default %cmake \ + %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 \ %__cmake \\\ -DCMAKE_C_FLAGS_RELEASE:STRING="-DNDEBUG" \\\ -DCMAKE_CXX_FLAGS_RELEASE:STRING="-DNDEBUG" \\\