dev-cpp/cld3: fix build with abseil-cpp-20260107

Don't inject `CMAKE_CXX_STANDARD` into the `CMakeLists.txt`. It should
have included `CACHE STRING ""` anyway to allow override.
Instead pass `CMAKE_CXX_STANDARD` as commandline argument.

Closes: https://bugs.gentoo.org/976176
Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/46315
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Paul Zander
2026-05-28 15:14:55 +02:00
committed by Sam James
parent d9c4fce156
commit 3fe6240c44

View File

@@ -1,4 +1,4 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -27,11 +27,6 @@ src_prepare() {
sed -e '/add_definitions(/d' \
-i CMakeLists.txt || die
# Specify the c++ standard through cmake's heurestics instead
cat >> CMakeLists.txt <<- 'EOF' || die
set(CMAKE_CXX_STANDARD 17)
EOF
# Link with the right libraries for the tests
cat >> CMakeLists.txt <<- 'EOF' || die
target_link_libraries(cld3
@@ -88,3 +83,17 @@ src_prepare() {
cmake_src_prepare
}
src_configure() {
local CXXSTD="17"
if has_version ">=dev-cpp/abseil-cpp-20260107.0"; then
# needs >=c++20
CXXSTD="20"
fi
local mycmakeargs=(
-DCMAKE_CXX_STANDARD="${CXXSTD}"
)
cmake_src_configure
}