[PATCH] D39994: Loosen MSVC 2017 path requirements

Zachary Turner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 15 18:34:07 PST 2017


zturner added a comment.

I'm not suuuper opposed, but at the same time if this code is bothering people (and it is, consistently), I don't changing the requirements from "confusing rule A" to "confusing rule B" is going to solve the long term burden that people keep running into.

Not asking you to do this work, but my ideal solution is probably to teach clang-cl to recognize 3 new environment variables.

`CLANGCL_MSVC_BIN` - Where to look for `cl.exe`, and `link.exe`. Under no circumstances do we consult `PATH` or anything else.  This is only used when we need to fallback to `cl` (rarely, anymore) or when the compiler needs to invoke the linker.   But!  At the same time we make `-fuse-ld=lld` the default.  We only do something else if the user specifies `-fuse-ld=link`, and in that case it uses `CLANGCL_MSVC_BIN` (or if you specified `-fuse-ld=<abs path>` then the env var isn't needed).

`CLANGCL_WINSDK` - Points to the root of the Windows SDK.  The folder here should have a "standard" layout so that it least pretends to be an installation, so that we can find the right lib directory when cross-compiling.

`CLANGCL_MSVCRT` - Same as before, but for the CRT.

I would honestly like to delete just about 100% of this stuff about finding MSVC.  We should just use exactly what we're told to use and nothing else.  Simple, easy to understand, and easy to explain.

Anyway, I'm just venting.  If rnk@ wants to lgtm this, I'm fine.


https://reviews.llvm.org/D39994





More information about the cfe-commits mailing list