media-libs/zxing-cpp: Fix build with >=libcxx-19

Closes: https://bugs.gentoo.org/939897
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
This commit is contained in:
Andreas Sturmlechner
2024-10-04 14:35:21 +02:00
parent fc5d371c6a
commit b6405d3992
3 changed files with 61 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
From 77475338af4920fe2568d69b2318a0d5e9be77ce Mon Sep 17 00:00:00 2001
From: axxel <awagger@gmail.com>
Date: Fri, 15 Mar 2024 22:23:17 +0100
Subject: [PATCH] cmake: if (NOT CMAKE_CXX...) should have been if (NOT DEFINED
CMAKE_CXX...)
---
CMakeLists.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 678fa6b62b..d7a1d81c85 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -61,10 +61,10 @@ if(NOT BUILD_DEPENDENCIES IN_LIST BUILD_DEPENDENCIES_LIST)
message(FATAL_ERROR "BUILD_DEPENDENCIES must be one of ${BUILD_DEPENDENCIES_LIST}")
endif()
-if (NOT CMAKE_CXX_STANDARD)
+if (NOT DEFINED CMAKE_CXX_STANDARD)
set (CMAKE_CXX_STANDARD 17)
endif()
-if (NOT CMAKE_CXX_EXTENSIONS)
+if (NOT DEFINED CMAKE_CXX_EXTENSIONS)
set (CMAKE_CXX_EXTENSIONS OFF)
endif()

View File

@@ -0,0 +1,29 @@
From d98739ceaac1c477879b9c4fba89ea76dba2d539 Mon Sep 17 00:00:00 2001
From: axxel <awagger@gmail.com>
Date: Sun, 22 Sep 2024 22:39:11 +0200
Subject: [PATCH] cmake: switch to c++-20 by default for the core library
I finally accept the incurred performance penalty from the position
independent DataMatrix detection by default.
This is finally fixing #386. It also (sufficiently) fixes #822 and thereby
supersedes #836.
---
CMakeLists.txt | 4 +++-
1 file changed, 3 insertions(+), 1 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b602712d79..fee4c68cdc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -71,7 +71,9 @@ if(NOT ZXING_DEPENDENCIES IN_LIST ZXING_DEPENDENCIES_LIST)
endif()
if (NOT DEFINED CMAKE_CXX_STANDARD)
- set (CMAKE_CXX_STANDARD 17)
+ set (CMAKE_CXX_STANDARD 20)
+ # Allow the fallback to earlier versions if the compiler does not support it.
+ set(CMAKE_CXX_STANDARD_REQUIRED OFF)
endif()
if (NOT DEFINED CMAKE_CXX_EXTENSIONS)
set (CMAKE_CXX_EXTENSIONS OFF)

View File

@@ -14,6 +14,11 @@ SLOT="0/3"
KEYWORDS="amd64 ~arm arm64 ~loong ppc64 ~riscv x86"
IUSE=""
PATCHES=(
"${FILESDIR}/${P}-cmake.patch"
"${FILESDIR}/${P}-cxx20.patch" # bug 939897
)
src_configure() {
local mycmakeargs=(
-DBUILD_EXAMPLES=OFF # nothing is installed