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(
1290
1290
genericSubInvocation.setImportSearchPaths (SearchPathOpts.ImportSearchPaths );
1291
1291
genericSubInvocation.setFrameworkSearchPaths (SearchPathOpts.FrameworkSearchPaths );
1292
1292
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 ));
1293
1300
genericSubInvocation.setSDKPath (SearchPathOpts.SDKPath );
1294
1301
}
1295
1302
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
213
213
/// --------Clang module SwiftShims
214
214
// CHECK-LABEL: "modulePath": "SwiftShims.pcm",
215
215
216
- // CHECK-NO-SEARCH-PATHS-NOT: "-sdk"
217
216
// CHECK-NO-SEARCH-PATHS-NOT: "-prebuilt-module-cache-path"
218
217
219
218
// Check make-style dependencies
You can’t perform that action at this time.
0 commit comments