Skip to content
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

Add MAGIC_ENUM_USE_STD_MODULE option to use standard library module. #350

Merged
merged 7 commits into from
May 27, 2024
Merged

Add MAGIC_ENUM_USE_STD_MODULE option to use standard library module. #350

merged 7 commits into from
May 27, 2024

Conversation

stripe2933
Copy link
Contributor

@stripe2933 stripe2933 commented May 11, 2024

This PR adds two functionalities:

  • When user declares MAGIC_ENUM_USE_STD_MODULE macro, standard library header inclusions are skipped, and it uses import std; instead. It prevents multiple header compilation and improves the build time. This only affects to the codebase when user use magic_enum.cppm module and declare the macro. Similar structure to argparse.cppm.
  • Export std::formatter template specialization, which was missing in PR Support C++20 module. #343.

Fix: Commit a3934f7

  • Move magic_enum.cppm module file to module directory, since module is not header file and doesn't match to the meaning of include.

@Neargye
Copy link
Owner

Neargye commented May 25, 2024

Hi,
Could you please add minimal example?

@stripe2933
Copy link
Contributor Author

Here's the sample project with CMake, including Clang CI.

@Neargye
Copy link
Owner

Neargye commented May 27, 2024

Thanks!

@Neargye Neargye merged commit db0b726 into Neargye:master May 27, 2024
18 checks passed
@Neargye Neargye added this to the v0.9.6 milestone Jun 29, 2024
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.

2 participants