Skip to content

Commit aa64a62

Browse files
authored
Update boost build env (#347)
after updating boost in #314, this PR fixes some issues: - newer versions of boost require linking the process library, see Compiling Boost.Process as header-only fails boostorg/process#390 - older versions don't ship boost process and the upcoming 1.89 might go back to header-only - fix linking on macos for newer boost and remove pinning 1.85 - reason: upstream brew package removed boost_thread-mt, now there is only boost_thread (-mt is now default), same as on Linux - Mac users that compile from source need to update boost - fix cmake deprecation warning - only applies to very old boost versions which aren't supported anyway, raised the minimum required versions to 1.80 for boost process v2 - update ubuntu version for rust workflow to get newer boost there - rust bindings don't support keyvi index, that's why the newer boost wasn't necessary
1 parent 73ff486 commit aa64a62

3 files changed

Lines changed: 16 additions & 5 deletions

File tree

.github/workflows/python-cibuildwheel.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ jobs:
6464
run: |
6565
brew update && \
6666
brew list -1 | grep python | while read formula; do brew unlink $formula; brew link --overwrite $formula; done && \
67-
brew install ccache zlib snappy boost@1.85
68-
brew link boost@1.85
67+
brew install ccache zlib snappy boost
6968
7069
- name: set mac deployment target X64
7170
if: runner.os == 'macOS' && runner.arch == 'X64'

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ env:
1111

1212
jobs:
1313
build:
14-
runs-on: ubuntu-22.04
14+
runs-on: ubuntu-24.04
1515
steps:
1616
- uses: actions/checkout@v4
1717
- name: Install system packages

CMakeLists.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,30 @@ set(Boost_USE_STATIC_LIBS OFF)
6565
set(Boost_USE_MULTITHREADED ON)
6666
set(Boost_USE_STATIC_RUNTIME OFF)
6767

68-
find_package(Boost REQUIRED COMPONENTS ${_KEYVI_BOOST_LIBRARIES} ${_KEYVI_BOOST_LIBRARIES_TEST})
68+
if(POLICY CMP0167) # Use upstream's FindBoost.cmake to find Boost libraries.
69+
cmake_policy(SET CMP0167 NEW)
70+
endif()
71+
72+
find_package(Boost 1.80 REQUIRED COMPONENTS ${_KEYVI_BOOST_LIBRARIES} ${_KEYVI_BOOST_LIBRARIES_TEST})
6973
if (Boost_FOUND)
7074
list(APPEND KEYVI_INCLUDES "${Boost_INCLUDE_DIRS}")
7175
else ()
7276
message(FATAL_ERROR "Can not find Boost")
7377
endif ()
7478
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
75-
set(_KEYVI_LINK_LIBRARIES_STATIC "${_KEYVI_LINK_LIBRARIES_STATIC} boost_program_options boost_iostreams boost_filesystem boost_system boost_regex boost_thread-mt")
79+
set(_KEYVI_LINK_LIBRARIES_STATIC "${_KEYVI_LINK_LIBRARIES_STATIC} boost_program_options boost_iostreams boost_filesystem boost_system boost_regex boost_thread")
7680
else ()
7781
set(_KEYVI_LINK_LIBRARIES_DYNAMIC "${_KEYVI_LINK_LIBRARIES_DYNAMIC} boost_program_options boost_iostreams boost_filesystem boost_system boost_regex boost_thread")
7882
endif ()
7983

84+
if(Boost_VERSION VERSION_GREATER_EQUAL "1.86.0")
85+
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
86+
set(_KEYVI_LINK_LIBRARIES_STATIC "${_KEYVI_LINK_LIBRARIES_STATIC} boost_process")
87+
else ()
88+
set(_KEYVI_LINK_LIBRARIES_DYNAMIC "${_KEYVI_LINK_LIBRARIES_DYNAMIC} boost_process")
89+
endif ()
90+
endif ()
91+
8092
if (WIN32)
8193
# required for libboost_zlib
8294
# disable autolinking in boost

0 commit comments

Comments
 (0)