friendlyanon / cmake-init

The missing CMake project initializer
GNU General Public License v3.0
2.03k stars 77 forks source link

Update language standard for C and C++ #100

Closed avitase closed 9 months ago

avitase commented 11 months ago

By now, most compilers support C++23, and even C23.

See

For this to work the CMake version has to be bumped to at least 3.21, though.

friendlyanon commented 11 months ago

For this to work the CMake version has to be bumped to at least 3.21, though.

But also, I want the C++23 template to be using modules and import std;, so that still has to wait a little.

If you still wish to work on a PR for C23, then you'd also have to make sure that project-is-top-level.cmake is not used nor generated, since 3.21 is where the variable was introduced to CMake. For cmake_minimum_required, a new boolean variable c23 ought to work with {% if c23 %}3.21{% else %}3.14{% end %}.

avitase commented 11 months ago

make sure that project-is-top-level.cmake is not used nor generated, since 3.21 is where the variable was introduced to CMake

does it hurt to still set this variable manually for 3.21+ ?

friendlyanon commented 11 months ago

No, but the whole point of that file is to "polyfill" that feature. If the feature is already there, then there is no purpose to that file anymore.

avitase commented 11 months ago

That's true. This was my lame excuse to avoid adding branches that will become obsolete once the global 3.14 requirement for CMake gets bumped ;)

friendlyanon commented 10 months ago

Are you interested in working further on this PR?

friendlyanon commented 9 months ago

Please open a new PR if you wish to work on the C project generation.