Don't suggest using 'xcrun' when not on OS X.

Also, suggest "xcrun swiftc" instead of "xcrun swift" on OS X, since
"swift" already infers SDKs and we shouldn't get into this situation.
(We shouldn't get into it on non-OS-X either thanks to the previous
commit, but just in case.)

rdar://problem/22440615

Swift SVN r31535
This commit is contained in:
Jordan Rose
2015-08-27 18:47:26 +00:00
parent c1ab32e7f2
commit 7ec4c4fef3
4 changed files with 8 additions and 8 deletions

View File

@@ -253,7 +253,8 @@ FileUnit *SerializedModuleLoader::loadAST(
missingNames);
}
if (Ctx.SearchPathOpts.SDKPath.empty()) {
if (Ctx.SearchPathOpts.SDKPath.empty() &&
llvm::Triple(llvm::sys::getProcessTriple()).isMacOSX()) {
Ctx.Diags.diagnose(SourceLoc(), diag::sema_no_import_no_sdk);
Ctx.Diags.diagnose(SourceLoc(), diag::sema_no_import_no_sdk_xcrun);
}
@@ -263,7 +264,8 @@ FileUnit *SerializedModuleLoader::loadAST(
case serialization::Status::MissingShadowedModule: {
Ctx.Diags.diagnose(*diagLoc, diag::serialization_missing_shadowed_module,
M.getName());
if (Ctx.SearchPathOpts.SDKPath.empty()) {
if (Ctx.SearchPathOpts.SDKPath.empty() &&
llvm::Triple(llvm::sys::getProcessTriple()).isMacOSX()) {
Ctx.Diags.diagnose(SourceLoc(), diag::sema_no_import_no_sdk);
Ctx.Diags.diagnose(SourceLoc(), diag::sema_no_import_no_sdk_xcrun);
}