llvm's minimum fms-compatability-version was just bumped to 19.14 and
thus the WinMsvc.cmake file needs to be adjusted accordingly.
Details
Diff Detail
Event Timeline
LGTM
I'm not sure why we even have the explicit compatibility version setting ... can we just get rid of it now and rely on the default? That's fine as a follow-up change though.
We should raise the default _MSC_VER, but IMO that's separable, and I wouldn't rely on it. For cross-compilation, I would recommend setting an explicit version. Otherwise, the very host-specific auto-detection logic could run, and it might produce strange results on a Linux system.
Shouldn't we bypass the MSVC toolchain auto-detection on Linux? What is the recommended way to cross-compile Windows binaries on Linux? We would still need a copy of the VC build tools & Win SDK to build, right? (at least for the includes and the libs)
From Windows, I've tried:
> pscp -r "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29333" aganea@LINUX-BOX:/mnt/vs2019/ > ssh LINUX-BOX ... $ clang-cl /c a.cpp /vctoolsdir"/mnt/vs2019/"
But that still reports -fms-compatibility-version=19.11 because the auto-detection code is skipped on non-Windows: https://github.com/llvm/llvm-project/blob/93671fffb5ef37060da54199cb9e009188f63a0e/clang/lib/Driver/ToolChains/MSVC.cpp#L1222
I suppose on Linux we could manually extract the VS_VERSION_INFO from the EXE.
You cheated, you actually looked at the code instead of speculating wildly about what might happen. :)
Given that the autodetection isn't a concern, I guess it's reasonable to raise the default _MSC_VER in clang instead, since 19.11 is obviously too old: we implement ABI features added in 19.14.
Anyway, it's all the same to me.
Sorry, this was landed already but I forgot to put the Differential Revision: in! Closing it now. As far as the Windows changes you guys are talking about I'll leave up to you -- I'm not a Windows dev and was just maintaining a windows CI oncall last week.