[PATCH] D95472: clang-cl: Add /winsdkdir and /winsdkversion flags
Nico Weber via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 26 12:31:46 PST 2021
thakis created this revision.
thakis added a reviewer: hans.
Herald added a subscriber: dang.
Herald added a reviewer: jansvoboda11.
thakis requested review of this revision.
These do for the Windows SDK path what D85998 <https://reviews.llvm.org/D85998> did for
%VCToolsInstallDir% with /vctoolsdir: Offer a way to set them with an
explicit commandline switch.
With this (and /vctoolsdir), it's possible to compile and link
against hermetic vctools and winsdk directories with:
out/gn/bin/clang-cl win.c -fuse-ld=lld \
/vctoolsdir path/to/VC/Tools/MSVC/14.26.28801 \
/winsdkdir path/to/win_sdk
compared to a long list of -imsvc and /link /libpath: flags.
While here:
- Change the case of the "Include" folder inside the windows sdk from "include" to "Include" to match on-disk case. Since the Windows file system is case-insensitive this isn't a behavior change, it's just a bit cleaner.
- Add libpath tests to the /vctoolsdir
- Add a FIXME about reading env vars for win sdk and ucrt sdk if these flags aren't present, to match the VCToolsInstallDir logic
We should also cache all these computed paths in the driver instead
of computing them every time they're queried, but that's for a future
patch.
It'd also be nice to invent a /winsysroot: flag that sets both
/vctoolsdir: and /winsdkdir: to some well-known subdirectory.
That's for a future patch as well.
https://reviews.llvm.org/D95472
Files:
clang/include/clang/Driver/Options.td
clang/lib/Driver/ToolChains/MSVC.cpp
clang/lib/Driver/ToolChains/MSVC.h
clang/test/Driver/cl-options.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95472.319383.patch
Type: text/x-patch
Size: 10348 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210126/82b1f9f7/attachment.bin>
More information about the llvm-commits
mailing list