diff options
Diffstat (limited to 'clang/lib/Driver/ToolChains/MSVC.cpp')
| -rw-r--r-- | clang/lib/Driver/ToolChains/MSVC.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Driver/ToolChains/MSVC.cpp b/clang/lib/Driver/ToolChains/MSVC.cpp index 3ce1bfa0aa6..d062c6abc95 100644 --- a/clang/lib/Driver/ToolChains/MSVC.cpp +++ b/clang/lib/Driver/ToolChains/MSVC.cpp @@ -469,6 +469,9 @@ void visualstudio::Linker::ConstructJob(Compilation &C, const JobAction &JA, // their own link.exe which may come first. linkPath = FindVisualStudioExecutable(TC, "link.exe"); + if (!TC.FoundMSVCInstall() && !llvm::sys::fs::can_execute(linkPath)) + C.getDriver().Diag(clang::diag::warn_drv_msvc_not_found); + #ifdef _WIN32 // When cross-compiling with VS2017 or newer, link.exe expects to have // its containing bin directory at the top of PATH, followed by the @@ -684,8 +687,6 @@ MSVCToolChain::MSVCToolChain(const Driver &D, const llvm::Triple &Triple, } Tool *MSVCToolChain::buildLinker() const { - if (VCToolChainPath.empty()) - getDriver().Diag(clang::diag::warn_drv_msvc_not_found); return new tools::visualstudio::Linker(*this); } |

