[PATCH] Switch to C++17 for recent ICU4C versions
authorThomas Fischer <fischer@unix-ag.uni-kl.de>
Thu, 23 May 2024 17:59:51 +0000 (19:59 +0200)
committerPino Toscano <pino@debian.org>
Wed, 5 Feb 2025 17:10:17 +0000 (18:10 +0100)
Starting with ICU version 75, it makes use of C++ 17 constructs, so KBibTeX no longer
compiles if C++ is still set to C++ 11.
With this change, the C++ standard is raised to C++17 if a recent ICU is detected.

Gbp-Pq: Name upstream_Switch-to-C-17-for-recent-ICU4C-versions.patch

CMakeLists.txt

index 901e6979daa23b4550ec91b1ee1d51b746ca05d7..4ae3d63ec8b8ca666dd91e5ae0a983f0cb4d45c8 100644 (file)
@@ -137,6 +137,10 @@ find_package(
 )
 if(ICU_FOUND)
     add_definitions(-DHAVE_ICU)
+    if(ICU_VERSION GREATER_EQUAL 75)
+        # Starting with ICU 75, it makes use of C++17 instead of C++11 before
+        set(CMAKE_CXX_STANDARD 17)
+    endif()
 endif()
 
 option(