Seems like there is no way to specify C standard for Visual Studio 2019 project (supported since 16.8).
- As expected, CONFIG += c11 does not work.
- QMAKE_CFLAGS += -std:c11 does not work — QMAKE_CFLAGS just ignored.
- QMAKE_CXXFLAGS += -std:c11 causes error for C++ sources:
I roughly know how to add support of this options to qmake at sources level (possible patch attached), but have no idea how it should be implement at another levels for automatically set flags when CONFIG contains c11 or c17.
Guess it should start with something like that in msvc-version.conf:
qmake still does not work correctly with attached patch because moc_predefs.h generation calls cl.exe with raw QMAKE_CXXFLAGS (with incompatible -std:c++xx and -std:cxx flags). It looks like it's time to start use QMAKE_CFLAGS for MSVC.
As workaround, I move -std:cxx options from QMAKE_CXXFLAGS to QMAKE_CFLAGS and add QMAKE_CFLAGS parsing to VcprojGenerator. It works for me, but I'm not sure that this is the good solution.