Gentoo Archives: gentoo-dev

From: James Le Cuirot <chewi@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH 2/2] cmake-utils.eclass: export compilers to environment instead of setting in toolchain file, bug 542530
Date: Fri, 04 Nov 2016 12:33:53
Message-Id: 20161104123337.6c72cab7@red.yakaraplc.local
In Reply to: Re: [gentoo-dev] [PATCH 2/2] cmake-utils.eclass: export compilers to environment instead of setting in toolchain file, bug 542530 by Alexis Ballier
1 On Fri, 4 Nov 2016 13:20:16 +0100
2 Alexis Ballier <aballier@g.o> wrote:
3
4 > On Thu, 3 Nov 2016 00:52:17 +0100
5 > Maciej Mrozowski <reavertm@×××××.com> wrote:
6 >
7 > > From: Maciej Mrozowski <reavertm@g.o>
8 > >
9 > > ---
10 > > eclass/cmake-utils.eclass | 6 +++---
11 > > 1 file changed, 3 insertions(+), 3 deletions(-)
12 > >
13 > > diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass
14 > > index 88d2163..23cc094 100644
15 > > --- a/eclass/cmake-utils.eclass
16 > > +++ b/eclass/cmake-utils.eclass
17 > > @@ -525,13 +525,13 @@ enable_cmake-utils_src_configure() {
18 > >
19 > > local toolchain_file=${BUILD_DIR}/gentoo_toolchain.cmake
20 > > cat > ${toolchain_file} <<- _EOF_ || die
21 > > - SET (CMAKE_C_COMPILER $(tc-getCC))
22 > > - SET (CMAKE_CXX_COMPILER $(tc-getCXX))
23 > > - SET (CMAKE_Fortran_COMPILER $(tc-getFC))
24 > > SET (CMAKE_AR $(type -P $(tc-getAR)) CACHE
25 > > FILEPATH
26 >
27 >
28 > Have you tested cross compiling ?
29 > IIRC toolchain file is used *before* getting those vars from env and
30 > is used to determine system & compiler type. Without this you get
31 > bugs like #503216
32
33 I was dubious (since I filed that bug) but I briefly tested by
34 cross-compiling media-libs/openal and it worked. I didn't think to try
35 older CMake versions though. The behaviour might have changed.
36
37 --
38 James Le Cuirot (chewi)
39 Gentoo Linux Developer

Replies