Gentoo Archives: gentoo-dev

From: Azamat Hackimov <azamat.hackimov@×××××.com>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] How to add -std=c++14 to CXXFLAGS of a cmake.eclass based package?
Date: Sat, 17 Dec 2022 13:06:08
Message-Id: CAFqVybrCgriQrR_LOqHom3VbgEEd85Qj3YP=ybd5bp9LR8om2Q@mail.gmail.com
In Reply to: [gentoo-dev] How to add -std=c++14 to CXXFLAGS of a cmake.eclass based package? by Andrey Grozin
1 Hello.
2
3 You need to add
4
5 set(CMAKE_CXX_STANDARD 14)
6 set(CMAKE_CXX_STANDARD_REQUIRED ON)
7
8 into CMakeLists.txt after project() declaration via patching. Since
9 this is an upstream issue, you need to notify upstream about C++17
10 incompatibility.
11
12 сб, 17 дек. 2022 г. в 14:35, Andrey Grozin <grozin@×××××××××××××××××.org>:
13 >
14 > Hello *,
15 >
16 > I'm trying to package a new version of sci-visualization/gle which now
17 > uses cmake. After some patching CMakeLists.txt, it configures
18 > successfully. But at build time it spits zillion errors
19 >
20 > error: ISO C++17 does not allow dynamic exception specifications
21 >
22 > The natural thing to try is to add -std=c++14 to CXXFLAGS. So I tried
23 >
24 > src_compile() {
25 > CXXFLAGS="${CXXFLAGS} -std=c++14" cmake_src_compile
26 > }
27 >
28 > but this makes no difference, c++17 is still used. How to convince
29 > cmake_src_compile to use -std=c++14?
30 >
31 > Thanks in advance,
32 > Andrey
33 >
34
35
36 --
37 From Siberia with Love!

Replies

Subject Author
Re: [gentoo-dev] How to add -std=c++14 to CXXFLAGS of a cmake.eclass based package? Azamat Hackimov <azamat.hackimov@×××××.com>