-
Notifications
You must be signed in to change notification settings - Fork 585
Fix windows build errors with boost 1.88.0
#10419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Have you tested if this is still required on windows with Currently when running cmake we're getting the warning that the policy is not set which means that we're using cmake's FindBoost module instead of boost's BoostConfig.cmake. The help page to this policy explicitly mentions better support of new boost versions. When going through BoostConfig.cmake I can't see anything that explicitly links |
No, I didn't but even then we can't use it here. The CMake docs for it says this:
And our minimum supported Boost version is Line 5 in a65f2d6
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not to also bump ours to v1.88 while on it?
if ("${Boost_VERSION}" GREATER_EQUAL 1.88.0) | ||
set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} psapi.lib") | ||
set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} psapi.lib") | ||
endif () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ("${Boost_VERSION}" GREATER_EQUAL 1.88.0) | |
set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} psapi.lib") | |
set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} psapi.lib") | |
endif () | |
set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} psapi.lib") | |
set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} psapi.lib") |
Boost 1.88.0 introduced a feature 1 that makes use of the Windows API, so we need to link against the psapi library. Actually, that new feature can also be disabled by setting the
BOOST_STACKTRACE_DISABLE_OFFSET_ADDR_BASE
macro, but since it seems to be a useful feature and isn't even disabled by default, it's better to add the missing library to the linker flags instead of disabling it.Note: The reason why we're linking statically (psapi.lib) instead of dynamically (psapi.dll) is that we've already set boost to link statically here, so we need to do the same for psapi.
icinga2/CMakeLists.txt
Lines 135 to 136 in 520aed6
fixes #10412
Footnotes
https://github.com/boostorg/stacktrace/pull/200 ↩