Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Wed, 30 Nov 2016 09:42:30
Message-Id: 1480498931.92700a0e7bce7aeadaf65fb778cec49e5ebc594d.mgorny@gentoo
1 commit: 92700a0e7bce7aeadaf65fb778cec49e5ebc594d
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Nov 27 13:28:55 2016 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Nov 30 09:42:11 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=92700a0e
7
8 cmake-utils.eclass: Wipe out default flags for std build types
9
10 Wipe out the default compiler & linker flags that are forced by CMake
11 for the standard build types. This improves the sanity of the build if
12 we are forced to use one of those types.
13
14 eclass/cmake-utils.eclass | 13 +++++++++++++
15 1 file changed, 13 insertions(+)
16
17 diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
18 index fbd60c2..b21435b 100644
19 --- a/eclass/cmake-utils.eclass
20 +++ b/eclass/cmake-utils.eclass
21 @@ -599,6 +599,19 @@ enable_cmake-utils_src_configure() {
22 _EOF_
23 [[ "${NOCOLOR}" = true || "${NOCOLOR}" = yes ]] && echo 'SET (CMAKE_COLOR_MAKEFILE OFF CACHE BOOL "pretty colors during make" FORCE)' >> "${common_config}"
24
25 + # Wipe the default optimization flags out of CMake
26 + if [[ ${CMAKE_BUILD_TYPE} != Gentoo ]] && ! has "${EAPI}" 2 3 4 5; then
27 + cat >> ${common_config} <<- _EOF_ || die
28 + SET (CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
29 + SET (CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
30 + SET (CMAKE_Fortran_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
31 + SET (CMAKE_EXE_LINKER_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
32 + SET (CMAKE_MODULE_LINKER_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
33 + SET (CMAKE_SHARED_LINKER_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
34 + SET (CMAKE_STATIC_LINKER_FLAGS_${CMAKE_BUILD_TYPE^^} "" CACHE STRING "")
35 + _EOF_
36 + fi
37 +
38 # Convert mycmakeargs to an array, for backwards compatibility
39 # Make the array a local variable since <=portage-2.1.6.x does not
40 # support global arrays (see bug #297255).