Skip to content

Commit 87bdf96

Browse files
committed
Add additional implicit framework search path for Darwin platforms
'/System/Library/SubFrameworks' will be searched for frameworks by the compiler implicitly when an SDK path is specified. Resolves rdar://137454957
1 parent eeb8412 commit 87bdf96

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

include/swift/AST/SearchPathOptions.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,13 @@ class SearchPathOptions {
405405
SmallString<128> systemFrameworksScratch(NewSDKPath);
406406
llvm::sys::path::append(systemFrameworksScratch, "System", "Library",
407407
"Frameworks");
408+
SmallString<128> systemSubFrameworksScratch(NewSDKPath);
409+
llvm::sys::path::append(systemSubFrameworksScratch, "System", "Library",
410+
"SubFrameworks");
408411
SmallString<128> frameworksScratch(NewSDKPath);
409412
llvm::sys::path::append(frameworksScratch, "Library", "Frameworks");
410413
DarwinImplicitFrameworkSearchPaths = {systemFrameworksScratch.str().str(),
414+
systemSubFrameworksScratch.str().str(),
411415
frameworksScratch.str().str()};
412416

413417
Lookup.searchPathsDidChange();
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// REQUIRES: objc_interop
2+
// RUN: %empty-directory(%t)
3+
// RUN: %empty-directory(%t/module-cache)
4+
// RUN: %empty-directory(%t/mock.sdk/System/Library)
5+
6+
// RUN: %empty-directory(%t/mock.sdk/System/Library/Frameworks)
7+
// RUN: %empty-directory(%t/mock.sdk/System/Library/SubFrameworks)
8+
9+
// RUN: %empty-directory(%t/mock.sdk/System/Library/Frameworks/E.framework/Modules/E.swiftmodule)
10+
// RUN: %empty-directory(%t/mock.sdk/System/Library/SubFrameworks/SubE.framework/Modules/SubE.swiftmodule)
11+
12+
// RUN: cp %S/Inputs/Swift/E.swiftinterface %t/mock.sdk/System/Library/Frameworks/E.framework/Modules/E.swiftmodule/%target-swiftinterface-name
13+
// RUN: cp %S/Inputs/Swift/SubE.swiftinterface %t/mock.sdk/System/Library/SubFrameworks/SubE.framework/Modules/SubE.swiftmodule/%target-swiftinterface-name
14+
15+
// RUN: %target-swift-frontend -scan-dependencies -module-cache-path %t/module-cache %s -o %t/deps.json -sdk %t/mock.sdk
16+
// RUN: %validate-json %t/deps.json | %FileCheck %s
17+
18+
import E
19+
import SubE
20+
21+
// CHECK: "mainModuleName": "deps"
22+
// CHECK: "swift": "E"
23+
// CHECK: "swift": "SubE"

0 commit comments

Comments
 (0)