Skip to content

Commit 930699c

Browse files
authored
Merge pull request #25902 from compnerd/sdk-on-non-darwin
2 parents ccc0a89 + f3655ed commit 930699c

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

lib/Frontend/CompilerInvocation.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ static void updateRuntimeLibraryPaths(SearchPathOptions &SearchPathOpts,
8989
if (!SearchPathOpts.SDKPath.empty()) {
9090
LibPath = SearchPathOpts.SDKPath;
9191
llvm::sys::path::append(LibPath, "usr", "lib", "swift");
92+
if (!Triple.isOSDarwin()) {
93+
llvm::sys::path::append(LibPath, getPlatformNameForTriple(Triple));
94+
llvm::sys::path::append(LibPath, swift::getMajorArchitectureName(Triple));
95+
}
9296
SearchPathOpts.RuntimeLibraryImportPaths.push_back(LibPath.str());
9397
}
9498
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// swift-interface-format-version: 1.0
2+
// swift-module-flags: -target x86_64-unknown-linux-android -disable-objc-interop -swift-version 5 -O -module-name Swift -parse-stdlib
3+

test/Driver/android-sdk.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// RUN: %swift -target x86_64-unknown-linux-android -sdk %S/Inputs/android.sdk %s -typecheck

0 commit comments

Comments
 (0)