Gentoo Archives: gentoo-dev

From: "Arsen Arsenović" <arsen@××××××.me>
To: gentoo-dev@l.g.o
Cc: Andrey Grozin <grozin@×××××××××××××××××.org>
Subject: Re: [gentoo-dev] How to add -std=c++14 to CXXFLAGS of a cmake.eclass based package?
Date: Sat, 17 Dec 2022 11:55:41
Message-Id: 86cz8ib5xp.fsf@aarsen.me
In Reply to: [gentoo-dev] How to add -std=c++14 to CXXFLAGS of a cmake.eclass based package? by Andrey Grozin
1 Hi,
2
3 Andrey Grozin <grozin@×××××××××××××××××.org> writes:
4
5 > Hello *,
6 >
7 > I'm trying to package a new version of sci-visualization/gle which now uses
8 > cmake. After some patching CMakeLists.txt, it configures successfully. But at
9 > build time it spits zillion errors
10 >
11 > error: ISO C++17 does not allow dynamic exception specifications
12 >
13 > The natural thing to try is to add -std=c++14 to CXXFLAGS. So I tried
14 >
15 > src_compile() {
16 > CXXFLAGS="${CXXFLAGS} -std=c++14" cmake_src_compile
17 > }
18 >
19 > but this makes no difference, c++17 is still used. How to convince
20 > cmake_src_compile to use -std=c++14?
21 >
22 > Thanks in advance,
23 > Andrey
24
25
26 audacity-2.4.2-r3.ebuild has something for this already:
27 ``append-cxxflags -std=gnu++14''
28
29 Check out flag-o-matic.eclass. Note that the build system could still
30 be overriding it, so if that fails, I'd check the compilation commands
31 for -std=... parameters, as well as CXX_STANDARD_LEVEL, or whatever
32 cmake calls it.
33
34 Hope that helps, have a great day.
35 --
36 Arsen Arsenović

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] How to add -std=c++14 to CXXFLAGS of a cmake.eclass based package? Andrey Grozin <grozin@×××××××××××××××××.org>