diff --git a/cmake.spec b/cmake.spec index a29af76..c3deaf6 100644 --- a/cmake.spec +++ b/cmake.spec @@ -13,7 +13,7 @@ Name: cmake Version: 2.8.11 -Release: 0.5.rc2%{?dist} +Release: 0.6.rc2%{?dist} Summary: Cross-platform make system Group: Development/Tools @@ -190,6 +190,9 @@ update-mime-database %{_datadir}/mime &> /dev/null || : %changelog +* Thu Apr 18 2013 Orion Poplawski - 2.8.11-0.6.rc2 +- Drop -O3 from default release build type flags in cmake rpm macro (bug 875954) + * Wed Apr 17 2013 Orion Poplawski - 2.8.11-0.5.rc2 - Update to 2.8.11-rc2 - Rebase ImageMagick patch diff --git a/macros.cmake b/macros.cmake index bfdadb8..9ef8331 100644 --- a/macros.cmake +++ b/macros.cmake @@ -6,6 +6,12 @@ %_cmake_version @@CMAKE_VERSION@@ %__cmake /usr/bin/cmake +# - Set default compile flags +# - CMAKE_*_FLAGS_RELEASE are added *after* the *FLAGS environment variables +# and default to -O3 -DNDEBUG. Strip the -O3 so we can override with *FLAGS +# - Turn on verbose makefiles so we can see and verify compile flags +# - Set default install prefixes and library install directories +# - Turn on shared libraries by default %cmake \ CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; \ CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; \ @@ -13,7 +19,10 @@ FCFLAGS="${FCFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}}" ; export FCFLAGS ; \ %{?__global_ldflags:LDFLAGS="${LDFLAGS:-%__global_ldflags}" ; export LDFLAGS ;} \ %__cmake \\\ - -DCMAKE_VERBOSE_MAKEFILE=ON \\\ + -DCMAKE_C_FLAGS_RELEASE:STRING="-DNDEBUG" \\\ + -DCMAKE_CXX_FLAGS_RELEASE:STRING="-DNDEBUG" \\\ + -DCMAKE_Fortran_FLAGS_RELEASE:STRING="-DNDEBUG" \\\ + -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \\\ -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \\\ -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \\\ -DLIB_INSTALL_DIR:PATH=%{_libdir} \\\