-
Notifications
You must be signed in to change notification settings - Fork 120
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
Allows using a pure modular build. #570
base: master
Are you sure you want to change the base?
Conversation
This allows the user to force modules to be used. Since the std module is enable it's not needed to include the Standard library headers. Clang 17 does not work properly in this case, so allow users to avoid these includes. Note static_asserts can't be exported so they are disabled.
@@ -274,17 +284,23 @@ inline constexpr const std::string_view need_name = | |||
"unique_name_for_auto_detect_prefix_and_suffix_lenght_0123456789_struct"; | |||
#endif | |||
inline constexpr const std::size_t need_length = need_name.length(); | |||
#if not defined(BOOST_UT_USE_MODULE) |
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.
Note this is not great. I think to solve this properly the selection of which declarations to export and not to export needs a rework. Either exporting in a smaller scope than the entire boost::ut
namespace or using using namespace::declaration
at the end of the header.
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 would +1 the explicit symbol export, as it also causes troubles when building with MSVC, see here for an example.
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'm happy with that too ☝️
This attaches the named declaration to the global module fragment instead of to the ut module. Also avoids exporting the std module.
This allows the user to force modules to be used. Since the std module is enable it's not needed to include the Standard library headers. Clang 17 does not work properly in this case, so allow users to avoid these includes.
Note static_asserts can't be exported so they are disabled.