-
Notifications
You must be signed in to change notification settings - Fork 59
Implement initial version of C++20 module boost.any
#30
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
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
fd0ac74
Implement initial version of C++20 module `boost.any`
apolukhin 6fcd093
Fixes and additions
apolukhin a62f524
Disable std module usage test
apolukhin f3dce63
docs
apolukhin b23a899
First portion of review fixes
apolukhin 23f4afe
cleanup
apolukhin c4d58be
update docs
apolukhin 8ff829b
update
apolukhin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,17 +2,48 @@ | |
| # Distributed under the Boost Software License, Version 1.0. | ||
| # See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt | ||
|
|
||
| cmake_minimum_required( VERSION 3.5...3.20 ) | ||
| cmake_minimum_required( VERSION 3.5...3.31 ) | ||
| project( boost_any VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX ) | ||
|
|
||
| add_library( boost_any INTERFACE ) | ||
| if (BOOST_USE_MODULES) | ||
| add_library(boost_any) | ||
| target_sources(boost_any PUBLIC | ||
| FILE_SET modules_public TYPE CXX_MODULES FILES | ||
| ${CMAKE_CURRENT_LIST_DIR}/modules/any.cppm | ||
| ) | ||
|
|
||
| target_compile_features(boost_any PUBLIC cxx_std_20) | ||
| target_compile_definitions(boost_any PUBLIC BOOST_USE_MODULES) | ||
| if (CMAKE_CXX_COMPILER_IMPORT_STD) | ||
| target_compile_definitions(boost_any PRIVATE BOOST_ANY_USE_STD_MODULE) | ||
| message(STATUS "Using `import std;`") | ||
| else() | ||
| message(STATUS "`import std;` is not awailable") | ||
| endif() | ||
| target_include_directories(boost_any PUBLIC include) | ||
| target_link_libraries( boost_any | ||
| PUBLIC | ||
| Boost::config | ||
| Boost::throw_exception | ||
| Boost::type_index | ||
| ) | ||
| else() | ||
| add_library(boost_any INTERFACE) | ||
| target_include_directories(boost_type_index INTERFACE include) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be |
||
|
|
||
| target_link_libraries( boost_any | ||
| INTERFACE | ||
| Boost::config | ||
| Boost::throw_exception | ||
| Boost::type_index | ||
| ) | ||
| endif() | ||
|
|
||
| add_library( Boost::any ALIAS boost_any ) | ||
|
|
||
| target_include_directories( boost_any INTERFACE include ) | ||
| enable_testing() | ||
| if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt") | ||
|
|
||
| add_subdirectory(test) | ||
|
|
||
| target_link_libraries( boost_any | ||
| INTERFACE | ||
| Boost::config | ||
| Boost::throw_exception | ||
| Boost::type_index | ||
| ) | ||
| endif() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| // Copyright Antony Polukhin, 2021-2025. | ||
| // | ||
| // Distributed under the Boost Software License, Version 1.0. (See | ||
| // accompanying file LICENSE_1_0.txt or copy at | ||
| // http://www.boost.org/LICENSE_1_0.txt) | ||
|
|
||
| #ifndef BOOST_ANY_ANYS_DETAIL_CONFIG_HPP | ||
| #define BOOST_ANY_ANYS_DETAIL_CONFIG_HPP | ||
|
|
||
| #ifdef BOOST_ANY_INTERFACE_UNIT | ||
| # define BOOST_ANY_BEGIN_MODULE_EXPORT export { | ||
| # define BOOST_ANY_END_MODULE_EXPORT } | ||
| #else | ||
| # define BOOST_ANY_BEGIN_MODULE_EXPORT | ||
| # define BOOST_ANY_END_MODULE_EXPORT | ||
| #endif | ||
|
|
||
| #if defined(BOOST_USE_MODULES) && !defined(BOOST_ANY_INTERFACE_UNIT) | ||
| import boost.any; | ||
| #endif | ||
|
|
||
| #endif // #ifndef BOOST_ANY_ANYS_DETAIL_CONFIG_HPP |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Convention is
boost_any.cppm