My compiler settings in CMakeLists.txt are as follows: cmakeminimumrequired (VERSION 3.21. cmakeminimumrequired (VERSION 3. I am trying to configure CMake to compile my C++ project using the C++20 standard, but it keeps compiling in C++17. Libc++ will automatically detect what Standard is being used and will provide functionality that matches that Standard in the library. If your wanting to specify a compiler in cmake then just do. If the value requested does not result in a compile flag being added for the compiler in use, a previous standard flag will be added instead. Changing the version of the standard can be done by passing -stdc++XY to the compiler. To expand a bit on the ADD_COMPILE_OPTIONS() with generator expression answer by ar31, you may run into a problem when you want to add multiple flags separated by spaces, as cmake has a nasty bug in generator expressions. CMake 3.25 and later recognize 26 as a valid value, no version has support for any compiler.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |