Allow C++20 in extensions

Recently I’ve discovered that modules were added in C++20. Modules replace the traditional header.h files in C++. Honestly I’ve been waiting for such feature since childhood as I dislike the header system in C++ the most.

Unfortunately Defold can’t build extensions with -std=c++20 flag saying it’s not a valid flag.

Can this flag be enabled?


@JCash, @britzl any thoughts on this?

Apart from adding the flag, I suspect you also need to add support for .ixx files?
Also, I’m not at all sure all compilers up-to-date with the modules support.

We will need to add C++20 support eventually, so the answer is yes, it’s possible to add the flag and the file extension support right now. If it works straight out of the box? Maybe.

I suggest you create a ticket on github so that our users can either vote on it or maybe even create a PR.


From series “I don’t know, but I put will comment regardless”, but if it is built with gcc, there are two flags, depending on the version:

std=c++2a for GCC 8—9
std=c++20 for >9

For me, also concepts are a game changer for templates writing, so much easier to define requirements for parameters in just one line :heart:

1 Like