File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -1290,6 +1290,13 @@ void InterfaceSubContextDelegateImpl::inheritOptionsForBuildingInterface(
12901290 genericSubInvocation.setImportSearchPaths (SearchPathOpts.ImportSearchPaths );
12911291 genericSubInvocation.setFrameworkSearchPaths (SearchPathOpts.FrameworkSearchPaths );
12921292 if (!SearchPathOpts.SDKPath .empty ()) {
1293+ // Add -sdk arguments to the module building commands.
1294+ // Module building commands need this because dependencies sometimes use
1295+ // sdk-relative paths (prebuilt modules for example). Without -sdk, the command
1296+ // will not be able to local these dependencies, leading to unnecessary
1297+ // building from textual interfaces.
1298+ GenericArgs.push_back (" -sdk" );
1299+ GenericArgs.push_back (ArgSaver.save (SearchPathOpts.SDKPath ));
12931300 genericSubInvocation.setSDKPath (SearchPathOpts.SDKPath );
12941301 }
12951302
Original file line number Diff line number Diff line change 1+ // RUN: %empty-directory(%t)
2+
3+ // RUN: %target-swift-frontend -scan-dependencies %s -o %t/deps.json -sdk %t/mysecretsdk.sdk
4+
5+ // Check the contents of the JSON output
6+ // RUN: %FileCheck %s < %t/deps.json
7+
8+ func foo( ) { print ( 1 ) }
9+
10+ // CHECK: "-sdk",
11+ // CHECK-NEXT: mysecretsdk.sdk
Original file line number Diff line number Diff line change @@ -213,7 +213,6 @@ import SubE
213213/// --------Clang module SwiftShims
214214// CHECK-LABEL: "modulePath": "SwiftShims.pcm",
215215
216- // CHECK-NO-SEARCH-PATHS-NOT: "-sdk"
217216// CHECK-NO-SEARCH-PATHS-NOT: "-prebuilt-module-cache-path"
218217
219218// Check make-style dependencies
You can’t perform that action at this time.
0 commit comments