[Lldb-commits] [PATCH] D57809: [build.py] Add `VCINSTALLDIR` to default variables
Pavel Labath via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Feb 6 01:53:46 PST 2019
labath requested changes to this revision.
labath added a comment.
This revision now requires changes to proceed.
I don't think this should be necessary. Based on my experiments, the fact whether clang-cl defines `char32_t` depends on the version of visual studio it is emulating (`-fms-compatibility-version`). For instance I can do this:
$ cat /tmp/a.cc
$ bin/clang-cl /tmp/a.cc /GS- /GR- /c -fms-compatibility-version=18
/tmp/a.cc(1,1) : error: unknown type name 'char32_t'
1 error generated.
$ bin/clang-cl /tmp/a.cc /GS- /GR- /c -fms-compatibility-version=19
$ bin/clang-cl /tmp/a.cc /GS- /GR- /c
So, what I suspect is happening is that clang uses %VCINSTALLDIR% to detect the MSVC version, and then sets the compatibility based on that. If the detected version is high enough, `char32_t` will be automatically defined. The interesting part is that, for me, the default version seems to be high enough that even without any special setting `char32_t` "just works". However, I'm on linux, so the differences could be due to that.
So I think this is good news. I hope all that's needed here is to get `build.py` to add the -fms-compatibility thingy and things should work. Until we actually need to vary this version, I think we can just unconditionally add that flag to all clang-cl invocations in build.py.
CHANGES SINCE LAST ACTION
More information about the lldb-commits