gentoo/app-i18n/libime/files/libime-1.1.11-fix-kenlm-odr.patch
Yongxiang Liang a0c1b7e6cc
app-i18n/libime: fix build with -Werror=odr
Fixes already accepted in upstream repo

Closes: https://bugs.gentoo.org/962546
Signed-off-by: Yongxiang Liang <tanekliang@gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/43758
Closes: https://github.com/gentoo/gentoo/pull/43758
Signed-off-by: Sam James <sam@gentoo.org>
2025-09-12 21:43:40 +01:00

23 lines
864 B
Diff

https://github.com/fcitx/libime/commit/39ced92b4450f49b03e38bdd6a58d1f1b9430824
fix odr: build kenlm with C++20
--- a/src/libime/core/CMakeLists.txt
+++ b/src/libime/core/CMakeLists.txt
@@ -14,9 +14,14 @@ target_include_directories(kenlm PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE
target_compile_definitions(kenlm PUBLIC -DKENLM_MAX_ORDER=3 PRIVATE -DNDEBUG)
target_link_libraries(kenlm PUBLIC Boost::boost PkgConfig::ZSTD)
set_target_properties(kenlm PROPERTIES
- CXX_STANDARD 11
POSITION_INDEPENDENT_CODE ON)
+include(CheckCXXSymbolExists)
+check_cxx_symbol_exists(_LIBCPP_VERSION version LIBCPP)
+if(LIBCPP)
+ target_compile_definitions(kenlm PUBLIC -D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION)
+endif()
+
if(UNIX)
check_library_exists(rt clock_gettime "clock_gettime from librt" HAVE_CLOCKGETTIME_RT)
if (HAVE_CLOCKGETTIME_RT)