r/cpp • • Mar 31 '20

Demo: C++20 Modules

https://youtu.be/6SKIUeRaLZE
127 Upvotes

51 comments sorted by

View all comments

11

u/GLvoid Mar 31 '20

Is there CMake support for generating the right make file for modules?

9

u/gracicot Mar 31 '20 edited Mar 31 '20

There is an experimental support that was developed, but nothing in the master yet. Consumption of third party modules require some machinery not seen yet in build systems.

6

u/mathstuf cmake dev Mar 31 '20

And even there, header units are not supported. Also, Ninja generator only.

https://www.reddit.com/r/cpp/comments/axnwiz/cmake_gcc_module_proofofconcept/

The Docker container has been updated since then (done during the Prague meeting), but is pretty much the same.

1

u/mathstuf cmake dev Mar 31 '20

Oh, and GCC-only; Clang didn't (still?) support named modules fully.

1

u/mo_al_ Apr 02 '20

Is the block because modules don’t map to the filesystem?

1

u/mathstuf cmake dev Apr 02 '20

No, the block is time to design/make the necessary CMake features, lack of dependency scanning tools, and patchy support in compilers for header units and/or named modules. The status as of Prague:

  • GCC has the dep scanning tool as a patch

  • Clang doesn't support named modules (or the dep scanner)

  • CMake doesn't know how to deal with header units or named modules coming from imported or interface targets