-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
6.2.2
-
None
(Using cmake 3.21 from the QtSDK installation, Apple clang 13.0.0.13000029)
I created a new Quick2 project in QtCreator and changed CMAKE_CXX_STANDARD to 20.
After this, cmake fails to configure (both native iOS and simulator) with a weird error that it couldn't detect HAVE_GETTIME. I traced it via CMakeError.log to the flags passed to clang when compiling code snippets via check_cxx_source_compiles. The actual problem is in FindWrapRt.cmake, where the compile snippet has int main(int argc, char *argv[]), but both argc and argv are unused.
In C++ 11 mode, clang is invoked with: ... --std\=gnu11 ..., but in C++20 mode, clang is invoked with: ... -Wall -Wextra -Werror -pedantic --std\=gnu++2a ...
I couldn't figure out where these additional flags are coming from.
I then tried to simply fix this by removing argument names, but this leads down a real rabbit hole: I found the same problem in FindGLESv2.cmake, but this wasn't enough there: that test is calling deprecated functions, which result in a warning, which in the end results in a compile error thanks to -Werror.