Add C++20 modules support
Hi, I'm not a user of harfbuzz, but I'm tracking the progress of c++20 modules support on https://arewemodulesyet.org/ and this is the issue we are linking to in our table of c++20 modules support.
Use Case
Modules are part of C++20 and should greatly decrease compile times, see https://en.cppreference.com/w/cpp/language/modules Proposed Solution
Can you please elaborate what the issue is? We compile HarfBuzz with c++20 to make sure it's compilable.
Modules are part of C++20 and should greatly increase compile times
I suppose you mean "decrease" compile times?
Can you please elaborate what the issue is? We compile HarfBuzz with c++20 to make sure it's compilable.
There can be issues when importing existing code into a module project. We had projects that do compile with c++20, but had errors when using in a modules project. Then the next step would to provide a module file, so you could simply write import harfbuzz;. For a more complete list of feature levels, see https://github.com/kelteseth/arewemodulesyet/issues/6
I suppose you mean "decrease" compile times?
Wups yes 😊
So if I understand correctly, you want us to add a harfbuzz.ixx that declares the module, then includes hb.h with HB_EXTERN defined to extern? What about the fact that modules do not encapsulate macros? We have quite a few public macros.
Yes, see vulkan-hpp for example.
I'm not sure about the specific implementation details that harfbuzz needs. Not allowing to export macros was an explicit feature in the modules spec IIRC, so this would be for sure a (big) breaking change for harfbuzz.
Thanks. This is beyond me to experiment with right now. Let's keep the issue open to see if there are any volunteers.
C++20 modules are not universally supported, and I have found that using meson unity build is enough to bring build times down to a few seconds.
Closing as I don’t see us doing this and no one is volunteering to do the work.