-
-
Notifications
You must be signed in to change notification settings - Fork 439
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
Adding option for downloading Boost using CMake FetchContent #6424
Conversation
Signed-off-by: Vedant <[email protected]>
Signed-off-by: Vedant <[email protected]>
Signed-off-by: Vedant <[email protected]>
Signed-off-by: Vedant <[email protected]>
Signed-off-by: Vedant <[email protected]>
Can one of the admins verify this patch? |
Signed-off-by: Vedant <[email protected]>
Signed-off-by: Vedant <[email protected]>
CMakeLists.txt
Outdated
hpx_option( | ||
HPX_WITH_FETCH_BOOST | ||
BOOL | ||
"Use FetchContent to fetch Asio. By default an installed Asio will be used. (default: OFF)" |
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.
Please change description
cmake/HPX_SetupBoost.cmake
Outdated
set(Boost_DIR "${CMAKE_BINARY_DIR}/_deps/boost-src") | ||
set(Boost_INCLUDE_DIR "${CMAKE_BINARY_DIR}/_deps/boost-src") |
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.
Are we sure this should not be internal?
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.
I guess it makes sense to keep it Internal, as it is set when the option is used, so should not be visible
Will make the changes
cmake/HPX_SetupBoost.cmake
Outdated
endif() | ||
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.
There are two endifs, does it not cause errors?
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.
Nevermind, seems like you have fixed it
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesYou may notice some variations in coverage metrics with the latest Coverage engine update. For more details, visit the documentation |
Signed-off-by: Vedant <[email protected]>
@hkaiser PTAL, thanks! |
cmake/HPX_SetupBoost.cmake
Outdated
execute_process( | ||
COMMAND | ||
cmd /C | ||
"cd ${CMAKE_BINARY_DIR}\\_deps\\boost-src && .\\bootstrap.bat && .\\b2 headers cxxflags=/std:c++20" |
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.
Should we compile with the C++ version that corresponds to what the user requested for HPX (HPX_CXX_STANDARD
)?
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.
Yes, we could do that. Will make the changes
cmake/HPX_SetupBoost.cmake
Outdated
execute_process( | ||
COMMAND | ||
sh -c | ||
"cd ${CMAKE_BINARY_DIR}/_deps/boost-src && ./bootstrap.sh --prefix=${CMAKE_BINARY_DIR}/_deps/boost-installed && ./b2 && ./b2 install --prefix=${CMAKE_BINARY_DIR}/_deps/boost-installed cxxflags=--std=c++20" |
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.
Same here (and in more places below). Should we use HPX_CXX_STANDARD
?
cmake/HPX_SetupBoost.cmake
Outdated
"cd ${CMAKE_BINARY_DIR}/_deps/boost-src && ./bootstrap.sh && ./b2 headers cxxflags=--std=c++20" | ||
) | ||
endif() | ||
set(EX_PRC_INTERNAL |
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.
What is this used for?
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.
It makes sure that the commands defined to build Boost are not executed again, if the project is reconfigured
But I noticed that I have mistakenly defined it as INTERNAL
instead of STRING
above. Will make the changes
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 this is something that is used outside of a CMake configuration step (e.g. needed for configuring dependent applications), please prefix the variable name with HPX_WITH_
for consistency and to avoid name clashes.
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.
Yes, it is used for configuring the building of fetched Boost, so will update with the variable naming you have mentioned.
"${CMAKE_BINARY_DIR}/_deps/boost-src" | ||
CACHE INTERNAL "" | ||
) | ||
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.
Should all of the above go into a separate file FindBoost.cmake
or similar (just for consistency reasons)? OTOH, this may conflict with the file with the same name in the CMake distribution...
…c changes Signed-off-by: Vedant <[email protected]>
Signed-off-by: Vedant <[email protected]>
cmake/HPX_SetupBoost.cmake
Outdated
execute_process( | ||
COMMAND | ||
sh -c | ||
"cd ${CMAKE_BINARY_DIR}/_deps/boost-src && ./bootstrap.sh && ./b2 headers cxxflags=--std=c++${HPX_WITH_CXX_STANDARD}" |
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.
"cd ${CMAKE_BINARY_DIR}/_deps/boost-src && ./bootstrap.sh && ./b2 headers cxxflags=--std=c++${HPX_WITH_CXX_STANDARD}" | |
"cd ${CMAKE_BINARY_DIR}/_deps/boost-src && ./bootstrap.sh && ./b2 headers cxxflags=--std=c++${HPX_CXX_STANDARD}" |
cmake/HPX_SetupBoost.cmake
Outdated
DOWNLOAD_EXTRACT_TIMESTAMP true | ||
) | ||
fetchcontent_populate(Boost) | ||
set(HPX_WITH_EX_PRC |
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.
Would you mind making this variable a bit more self-explanatory?
Signed-off-by: Vedant <[email protected]>
Fixes #6392
Proposed Changes
HPX_WITH_FETCH_BOOST
bool option for fetching Boost v1.84.0 using CMake FetchContentChecklist