With Visual Studio 2015 release, a part of runtime library was extracted and now comes with Windows Kits. This patch enables clang to use Universal CRT library if %INCLUDE or %LIB environment varaibles are not specified.
Details
Diff Detail
Event Timeline
lib/Driver/MSVCToolChain.cpp | ||
---|---|---|
118–130 | Refactor this into a helper like StringRef getWindowsSDKArch(llvm::Triple::Arch) and share it with getWindowsSDKLibraryPath. | |
lib/Driver/Tools.cpp | ||
8–11 | Does this have to be conditional on the version of the CRT in use? If I install VS 2013 and the ucrt and am trying to use the 2013 CRT, this will put both on the libpath. Is that a problem? |
- Extracted a function to convert an architecture type to a library subfolder name.
- Added a method to check if we should use Universal CRT depending on the chosen version of Visual Studio.
There's a bunch of whitespace issues that clang-format can resolve. We also have the convention that variables are StudlyCaps, which isn't followed in a few places.
Do you need someone to commit this for you? If so, I can patch this in, test it manually, and deal with the style stuff if you deal with the VSDir part.
lib/Driver/MSVCToolChain.cpp | ||
---|---|---|
293 | This should really take VSDir as a parameter instead of recomputing it, since all the callers are already computing it. |
Thanks! I'll reformat it.
We also have the convention that variables are StudlyCaps, which isn't followed in a few places.
I've tried to follow the style of the source file. Do you think I should force this rule here?
Do you need someone to commit this for you? If so, I can patch this in, test it manually, and deal with the style stuff if you deal with the VSDir part.
I'd really appreciate it. I'll prepare a new version in a few minutes.
- Fixed formatting issues.
- Normalized VariableNames.
- Reworked the useUniversalCRT method to receive a path of Visual Studio.
I'm sorry about leave D12604 hanging. I didn't notice that it got a new review message. Don't mind my patch -- please just submit when you got LGTM
Refactor this into a helper like StringRef getWindowsSDKArch(llvm::Triple::Arch) and share it with getWindowsSDKLibraryPath.