C++ standard to build CMake

According to my chat w/ GPT in 2024 I guess it’s quite possible to use at least C++14 to build CMake. It’s 10 years already since it was approved and seems most (all?) modern distributions have compilers with full support for it. I’m not a Windows or MAC user… but AFAIK Windows versions that are not EOL nowadays also have VS which is pretty capable of compiling C++14 as well. I guess smth similar for MACs…

So, maybe it’s time to stop limiting yourself to 13y.o. C++ standard and use smth newer?

P.S. Or maybe straight to C++ 17 which is already default in all that compilers mentioned in the table? (OK. maybe 'cept GCC 8.5 in CentOS 8, but it can compile C++17 w/ the corresponding option).

We’re limited to C++11 in order to support building on older AIX and Solaris platforms whose native tooling may never be updated again.

The CMake Source Code Guide documents compatibility wrappers we provide to support C++14, C++17, and C++20 standard library constructs.

Except for compatibility wrappers, many other language features would be nice to use that can’t be “wrapped” into a compatibility header.

We’re limited to C++11 in order to support building on older AIX and Solaris platforms whose native tooling may never be updated again.

Sorry, I didn’t get it… Why CMake code should take into account platforms that even vendors don’t care about updating? Why these platforms just can’t use current versions of CMake and need exactly the latest version of CMake???

1 Like

End users want to build recent software on their systems regardless of OS, and recent software may require recent CMake features to build. We’re not going to drop support for AIX and Solaris just so we can use newer C++ language features in our implementation.

More and more project requires alt least C++17 to build.

So if some end users want to build software for AIX or Solias, the should use also use old cmake binaries!

1 Like

Supporting “old” platforms and compilers make sense, but why imposing the constraint to be able to compile CMake with this environment?
For example, on AIX and Solaris, recent versions of gcc are available. So maybe it is acceptable to request some recent version of gcc to compile CMake. And, of course, the produced CMake binary will be able to manage standard platform compilers.

With a such approach, it will be easier to update C++ standard needed for CMake development.

Also, how are AIX and Solaris users obtaining CMake? If needed, would it be possible for Kitware or volunteers to provide binaries like LLVM does for AIX?

Brad notes CMake already has replacements for necessary standard library parts of c++14 and newer.

Key benefits of upgrading the minimum C++ standard for CMake itself include newer C++ language advancements like if-initializers to constrain variable scope. I.e. that can’t be introduced like the standard library replacements.