Skip to content

CMake: Fix build with Boost 1.89.0#199

Open
cho-m wants to merge 1 commit intodscharrer:masterfrom
cho-m:boost-1.89.0
Open

CMake: Fix build with Boost 1.89.0#199
cho-m wants to merge 1 commit intodscharrer:masterfrom
cho-m:boost-1.89.0

Conversation

@cho-m
Copy link

@cho-m cho-m commented Aug 11, 2025

In the upcoming Boost 1.89.0 release, the Boost.System stub library introduced back in 1.691 has been removed (boostorg/system@7a495bb), which causes a CMake error.

This PR change using OPTIONAL_COMPONENTS is based on upstream recommendation https://github.com/boostorg/system/issues/132#issuecomment-3146378680 given Boost 1.37 is still allowed.

Footnotes

  1. https://www.boost.org/doc/libs/1_69_0/libs/system/doc/html/system.html#changes_in_boost_1_69

@cho-m cho-m mentioned this pull request Aug 11, 2025
41 tasks
@cho-m cho-m marked this pull request as draft August 12, 2025 15:12
CMakeLists.txt Outdated
date_time
system
program_options
OPTIONAL_COMPONENTS
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made PR a draft as need to figure out CMake < 3.11 where OPTIONAL_COMPONENTS doesn't exist.

@cho-m cho-m marked this pull request as ready for review August 12, 2025 19:08
Comment on lines +182 to +186
find_package(Boost REQUIRED COMPONENTS ${BOOST_REQUIRED_COMPONENTS})
if(Boost_MAJOR_VERSION EQUAL 1 AND Boost_MINOR_VERSION LESS 69)
list(APPEND BOOST_REQUIRED_COMPONENTS system)
find_package(Boost REQUIRED COMPONENTS ${BOOST_REQUIRED_COMPONENTS})
endif()

This comment was marked as resolved.

Copy link
Author

@cho-m cho-m Aug 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boost_MAJOR_VERSION/Boost_MINOR_VERSION is set by the first find_package so change won't work.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ok. Doesn't knew that. :)

program_options
)
find_package(Boost REQUIRED COMPONENTS ${BOOST_REQUIRED_COMPONENTS})
if(Boost_MAJOR_VERSION EQUAL 1 AND Boost_MINOR_VERSION LESS 69)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(Boost_MAJOR_VERSION EQUAL 1 AND Boost_MINOR_VERSION LESS 69)
if(Boost_MAJOR_VERSION EQUAL 1 AND Boost_MINOR_VERSION LESS 89)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

system module/library is a stub since 1.69 according to the PR description, so this is correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants