serge-sans-paille / frozen

a header-only, constexpr alternative to gperf for C++14 users
Apache License 2.0
1.27k stars 103 forks source link

Add C++20 module #165

Open Arthapz opened 9 months ago

Arthapz commented 9 months ago

This PR add a C++20 module, enable examples with the module when EXAMPLES_USE_MODULE define is set and add xmake build system support (mainly to test module compilation, it's easier to write and use than CMake module support and i'm not a CMake user / expert)

the FROZEN_DONT_INCLUDE_STL can be set to remove #include of std lib for user that want to use C++23 std module we need this because mixing #include \<stdheader> / import \<stdheader> with C++23 std module doesn't work well atm on clang/GCC/msvc

to try it

install xmake: https://xmake.io/#/guide/installation

> xmake f --enable_tests=y --enable_module=y
> xmake b
> xmake run frozen.tests
> xmake run frozen.example.<example_name>

coverage is supported by using xmake coverage mode

> xmake f -m coverage