File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -125,8 +125,15 @@ static bool findVCToolChainViaEnvironment(std::string &Path,
125125 continue ;
126126
127127 // whatever/VC/bin --> old toolchain, VC dir is toolchain dir.
128- if (llvm::sys::path::filename (PathEntry) == " bin" ) {
129- llvm::StringRef ParentPath = llvm::sys::path::parent_path (PathEntry);
128+ llvm::StringRef TestPath = PathEntry;
129+ bool IsBin = llvm::sys::path::filename (TestPath).equals_lower (" bin" );
130+ if (!IsBin) {
131+ // Strip any architecture subdir like "amd64".
132+ TestPath = llvm::sys::path::parent_path (TestPath);
133+ IsBin = llvm::sys::path::filename (TestPath).equals_lower (" bin" );
134+ }
135+ if (IsBin) {
136+ llvm::StringRef ParentPath = llvm::sys::path::parent_path (TestPath);
130137 if (llvm::sys::path::filename (ParentPath) == " VC" ) {
131138 Path = ParentPath;
132139 IsVS2017OrNewer = false ;
You can’t perform that action at this time.
0 commit comments