From 6b94820761d4ce709f4350ba11bee37c21cdb688 Mon Sep 17 00:00:00 2001 From: ArkadyRudenko Date: Tue, 24 Nov 2026 17:30:45 +0600 Subject: [PATCH 1/5] fix cmake: fix CPM Boost with CMake 4.5 and link used Boost libraries --- cmake/SetupBoost.cmake | 4 ++++ cmake/boost_locale_cmake45.patch | 14 ++++++++++++++ core/CMakeLists.txt | 6 +++++- universal/CMakeLists.txt | 2 +- 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 cmake/boost_locale_cmake45.patch diff --git a/cmake/SetupBoost.cmake b/cmake/SetupBoost.cmake index f32a234a6e3d..83a8f38e3465 100644 --- a/cmake/SetupBoost.cmake +++ b/cmake/SetupBoost.cmake @@ -24,6 +24,9 @@ set(BOOST_INCLUDE_LIBRARIES endian assert predef + algorithm + exception + smart_ptr ) string(REGEX REPLACE ";" "\\\\\\\\;" BOOST_INCLUDE_LIBRARIES_LIST "${BOOST_INCLUDE_LIBRARIES}") @@ -55,6 +58,7 @@ cpmaddpackage( VERSION ${BOOST_VERSION} URL https://github.com/boostorg/boost/releases/download/boost-${BOOST_VERSION}/boost-${BOOST_VERSION}-cmake.tar.xz URL_HASH SHA256=67acec02d0d118b5de9eb441f5fb707b3a1cdd884be00ca24b9a73c995511f74 + PATCHES boost_locale_cmake45.patch OPTIONS "BOOST_ENABLE_CMAKE ON" "BOOST_INCLUDE_LIBRARIES ${BOOST_INCLUDE_LIBRARIES_LIST}" "BOOST_SKIP_INSTALL_RULES ON" diff --git a/cmake/boost_locale_cmake45.patch b/cmake/boost_locale_cmake45.patch new file mode 100644 index 000000000000..094006507605 --- /dev/null +++ b/cmake/boost_locale_cmake45.patch @@ -0,0 +1,14 @@ +--- a/libs/locale/CMakeLists.txt ++++ b/libs/locale/CMakeLists.txt +@@ -232,9 +232,10 @@ + list(FILTER sources_src INCLUDE REGEX "^src/") + set(sources_inc ${sources}) + list(FILTER sources_inc EXCLUDE REGEX "^src/") ++list(REMOVE_ITEM sources_inc "${CMAKE_CURRENT_SOURCE_DIR}/include/boost/locale.hpp") ++source_group("headers" FILES "include/boost/locale.hpp") + source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/src" PREFIX "sources" FILES ${sources_src}) + source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}/include/boost/locale" PREFIX "headers" FILES ${sources_inc}) +-source_group("headers" FILES "include/boost/locale.hpp") + + message(STATUS "Boost.Locale: " + "iconv ${BOOST_LOCALE_ENABLE_ICONV}, " diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index d122a837314a..407cc5bdeee5 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -107,7 +107,11 @@ target_link_libraries( ) if(TARGET Boost::endian) # Boost from CPM - target_link_libraries(${PROJECT_NAME} PUBLIC Boost::endian Boost::lockfree) + target_link_libraries( + ${PROJECT_NAME} + PUBLIC Boost::endian Boost::lockfree Boost::algorithm + PRIVATE Boost::exception + ) endif() list( diff --git a/universal/CMakeLists.txt b/universal/CMakeLists.txt index 9fd38bb5e545..f92645915284 100644 --- a/universal/CMakeLists.txt +++ b/universal/CMakeLists.txt @@ -247,7 +247,7 @@ if(BOOST_CPM) # Boost from CPM target_link_libraries( ${PROJECT_NAME} - PUBLIC Boost::uuid Boost::container + PUBLIC Boost::uuid Boost::container Boost::smart_ptr PRIVATE Boost::exception ) endif() From fb70305dbcf4658741103787e31d4d20f3a4297d Mon Sep 17 00:00:00 2001 From: ArkadyRudenko Date: Wed, 25 Nov 2026 02:11:17 +0600 Subject: [PATCH 2/5] rename Boost.Locale patch after upstream PR --- cmake/SetupBoost.cmake | 2 +- cmake/{boost_locale_cmake45.patch => boost_locale_pr_273.patch} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename cmake/{boost_locale_cmake45.patch => boost_locale_pr_273.patch} (100%) diff --git a/cmake/SetupBoost.cmake b/cmake/SetupBoost.cmake index 83a8f38e3465..b0c31744ef75 100644 --- a/cmake/SetupBoost.cmake +++ b/cmake/SetupBoost.cmake @@ -58,7 +58,7 @@ cpmaddpackage( VERSION ${BOOST_VERSION} URL https://github.com/boostorg/boost/releases/download/boost-${BOOST_VERSION}/boost-${BOOST_VERSION}-cmake.tar.xz URL_HASH SHA256=67acec02d0d118b5de9eb441f5fb707b3a1cdd884be00ca24b9a73c995511f74 - PATCHES boost_locale_cmake45.patch + PATCHES boost_locale_pr_273.patch OPTIONS "BOOST_ENABLE_CMAKE ON" "BOOST_INCLUDE_LIBRARIES ${BOOST_INCLUDE_LIBRARIES_LIST}" "BOOST_SKIP_INSTALL_RULES ON" diff --git a/cmake/boost_locale_cmake45.patch b/cmake/boost_locale_pr_273.patch similarity index 100% rename from cmake/boost_locale_cmake45.patch rename to cmake/boost_locale_pr_273.patch From 8ff11303579ab284b9cdd377e21b2f45f3f8dd15 Mon Sep 17 00:00:00 2001 From: ArkadyRudenko Date: Wed, 25 Nov 2026 15:23:44 +0600 Subject: [PATCH 3/5] link Boost::algorithm and Boost::exception only for CPM Boost --- core/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 407cc5bdeee5..c8c6db8a5d65 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -107,9 +107,12 @@ target_link_libraries( ) if(TARGET Boost::endian) # Boost from CPM + target_link_libraries(${PROJECT_NAME} PUBLIC Boost::endian Boost::lockfree) +endif() +if(BOOST_CPM) target_link_libraries( ${PROJECT_NAME} - PUBLIC Boost::endian Boost::lockfree Boost::algorithm + PUBLIC Boost::algorithm PRIVATE Boost::exception ) endif() From e9c462f9b0209f25c8bd5f65fc829d4da2b7e020 Mon Sep 17 00:00:00 2001 From: ArkadyRudenko Date: Fri, 27 Nov 2026 13:36:50 +0600 Subject: [PATCH 4/5] do not link Boost::smart_ptr --- universal/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/universal/CMakeLists.txt b/universal/CMakeLists.txt index f92645915284..9fd38bb5e545 100644 --- a/universal/CMakeLists.txt +++ b/universal/CMakeLists.txt @@ -247,7 +247,7 @@ if(BOOST_CPM) # Boost from CPM target_link_libraries( ${PROJECT_NAME} - PUBLIC Boost::uuid Boost::container Boost::smart_ptr + PUBLIC Boost::uuid Boost::container PRIVATE Boost::exception ) endif() From 2c3e38c8a7d0057bb6c29780fb74986b6d5d6ac7 Mon Sep 17 00:00:00 2001 From: ArkadyRudenko Date: Fri, 27 Nov 2026 14:22:08 +0600 Subject: [PATCH 5/5] do not list Boost dependencies in BOOST_INCLUDE_LIBRARIES --- cmake/SetupBoost.cmake | 3 --- 1 file changed, 3 deletions(-) diff --git a/cmake/SetupBoost.cmake b/cmake/SetupBoost.cmake index b0c31744ef75..bbd34fa01f9f 100644 --- a/cmake/SetupBoost.cmake +++ b/cmake/SetupBoost.cmake @@ -24,9 +24,6 @@ set(BOOST_INCLUDE_LIBRARIES endian assert predef - algorithm - exception - smart_ptr ) string(REGEX REPLACE ";" "\\\\\\\\;" BOOST_INCLUDE_LIBRARIES_LIST "${BOOST_INCLUDE_LIBRARIES}")