Gentoo Archives: gentoo-dev

From: Andrey Grozin <grozin@×××××××××××××××××.org>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] How to add -std=c++14 to CXXFLAGS of a cmake.eclass based package?
Date: Sat, 17 Dec 2022 11:35:09
Message-Id: e9f090d4-4137-9033-9771-6498abb2362e@woodpecker.gentoo.org
1 Hello *,
2
3 I'm trying to package a new version of sci-visualization/gle which now
4 uses cmake. After some patching CMakeLists.txt, it configures
5 successfully. But at build time it spits zillion errors
6
7 error: ISO C++17 does not allow dynamic exception specifications
8
9 The natural thing to try is to add -std=c++14 to CXXFLAGS. So I tried
10
11 src_compile() {
12 CXXFLAGS="${CXXFLAGS} -std=c++14" cmake_src_compile
13 }
14
15 but this makes no difference, c++17 is still used. How to convince
16 cmake_src_compile to use -std=c++14?
17
18 Thanks in advance,
19 Andrey

Replies