File indexing completed on 2026-05-10 08:44:45
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLVM_WINDOWSDRIVER_MSVCPATHS_H
0010 #define LLVM_WINDOWSDRIVER_MSVCPATHS_H
0011
0012 #include "llvm/ADT/SmallString.h"
0013 #include "llvm/ADT/StringRef.h"
0014 #include "llvm/TargetParser/Triple.h"
0015 #include <optional>
0016 #include <string>
0017
0018 namespace llvm {
0019
0020 namespace vfs {
0021 class FileSystem;
0022 }
0023
0024 enum class SubDirectoryType {
0025 Bin,
0026 Include,
0027 Lib,
0028 };
0029
0030 enum class ToolsetLayout {
0031 OlderVS,
0032 VS2017OrNewer,
0033 DevDivInternal,
0034 };
0035
0036
0037
0038
0039 const char *archToWindowsSDKArch(llvm::Triple::ArchType Arch);
0040
0041
0042 const char *archToLegacyVCArch(llvm::Triple::ArchType Arch);
0043
0044
0045 const char *archToDevDivInternalArch(llvm::Triple::ArchType Arch);
0046
0047 bool appendArchToWindowsSDKLibPath(int SDKMajor, llvm::SmallString<128> LibPath,
0048 llvm::Triple::ArchType Arch,
0049 std::string &path);
0050
0051
0052
0053
0054
0055 std::string getSubDirectoryPath(SubDirectoryType Type, ToolsetLayout VSLayout,
0056 const std::string &VCToolChainPath,
0057 llvm::Triple::ArchType TargetArch,
0058 llvm::StringRef SubdirParent = "");
0059
0060
0061
0062 bool useUniversalCRT(ToolsetLayout VSLayout, const std::string &VCToolChainPath,
0063 llvm::Triple::ArchType TargetArch,
0064 llvm::vfs::FileSystem &VFS);
0065
0066
0067 bool getWindowsSDKDir(vfs::FileSystem &VFS,
0068 std::optional<llvm::StringRef> WinSdkDir,
0069 std::optional<llvm::StringRef> WinSdkVersion,
0070 std::optional<llvm::StringRef> WinSysRoot,
0071 std::string &Path, int &Major,
0072 std::string &WindowsSDKIncludeVersion,
0073 std::string &WindowsSDKLibVersion);
0074
0075 bool getUniversalCRTSdkDir(vfs::FileSystem &VFS,
0076 std::optional<llvm::StringRef> WinSdkDir,
0077 std::optional<llvm::StringRef> WinSdkVersion,
0078 std::optional<llvm::StringRef> WinSysRoot,
0079 std::string &Path, std::string &UCRTVersion);
0080
0081
0082 bool findVCToolChainViaCommandLine(
0083 vfs::FileSystem &VFS, std::optional<llvm::StringRef> VCToolsDir,
0084 std::optional<llvm::StringRef> VCToolsVersion,
0085 std::optional<llvm::StringRef> WinSysRoot, std::string &Path,
0086 ToolsetLayout &VSLayout);
0087
0088
0089 bool findVCToolChainViaEnvironment(vfs::FileSystem &VFS, std::string &Path,
0090 ToolsetLayout &VSLayout);
0091
0092
0093
0094
0095
0096
0097
0098 bool
0099 findVCToolChainViaSetupConfig(vfs::FileSystem &VFS,
0100 std::optional<llvm::StringRef> VCToolsVersion,
0101 std::string &Path, ToolsetLayout &VSLayout);
0102
0103
0104
0105
0106 bool findVCToolChainViaRegistry(std::string &Path, ToolsetLayout &VSLayout);
0107
0108 }
0109
0110 #endif