File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -1195,6 +1195,13 @@ identifyMainModuleDependencies(CompilerInstance &instance) {
1195
1195
mainDependencies.addModuleImport (mainModule->getName ().str (),
1196
1196
&alreadyAddedModules);
1197
1197
}
1198
+
1199
+ // All modules specified with `-embed-tbd-for-module` are treated as implicit
1200
+ // dependnecies for this compilation since they are not guaranteed to be impored
1201
+ // in the source.
1202
+ for (const auto &tbdSymbolModule : instance.getInvocation ().getTBDGenOptions ().embedSymbolsFromModules ) {
1203
+ mainDependencies.addModuleImport (tbdSymbolModule, &alreadyAddedModules);
1204
+ }
1198
1205
}
1199
1206
1200
1207
return mainDependencies;
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: mkdir -p %t/clang-module-cache
3
+
4
+ // RUN: %target-swift-frontend -scan-dependencies -module-cache-path %t/clang-module-cache %s -o %t/deps.json -I %S/Inputs/CHeaders -I %S/Inputs/Swift -swift-version 4 -embed-tbd-for-module E
5
+ // RUN: %FileCheck %s < %t/deps.json
6
+
7
+ // CHECK: "mainModuleName": "deps"
8
+ // CHECK-NEXT: "modules": [
9
+ // CHECK-NEXT: {
10
+ // CHECK-NEXT: "swift": "deps"
11
+ // CHECK-NEXT: },
12
+ // CHECK: "directDependencies": [
13
+
14
+ // Ensure there is a dependency on 'E' even though it is not explicitly imported
15
+ // CHECK: "swift": "E"
16
+
You can’t perform that action at this time.
0 commit comments