[PATCH] D131367: [CMake] Check CMAKE_CXX_STANDARD and error if it's to old

Roy Jacobson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 7 14:00:11 PDT 2022


royjacobson accepted this revision.
royjacobson added a comment.
This revision is now accepted and ready to land.

Wow, that was quick, thanks!

I played with it a bit locally and it seems to solve this problem. I have one comment about the fatal error, but otherwise LGTM.



================
Comment at: llvm/CMakeLists.txt:71
+
+# if CMAKE_CXX_STANDARD is still set after the cache unset above it means that the user requested it
+# and we allow it to be set to something newer than the required standard but otherwise we fail.
----------------
I tried to give it an explicit `-DCMAKE_CXX_STANDARD=14` and it will warn and reset it to 17, but not error. It's an improvement over silently using 14 which we do now, but even with the warning it might be slightly surprising? Personally I think you can just get rid of this check.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131367/new/

https://reviews.llvm.org/D131367



More information about the llvm-commits mailing list