@@ -27,24 +27,26 @@ import func TSCBasic.topologicalSort
27
27
if let currentInfo = modules [ swiftModuleId] ,
28
28
externalModuleId. moduleName != mainModuleName {
29
29
let newExternalModuleDetails =
30
- try SwiftPrebuiltExternalModuleDetails ( compiledModulePath:
31
- TextualVirtualPath ( path: VirtualPath . absolute ( externalModulePath) . intern ( ) ) ,
32
- isFramework: externalModuleDetails. isFramework)
30
+ SwiftPrebuiltExternalModuleDetails ( compiledModulePath:
31
+ TextualVirtualPath ( path: VirtualPath . absolute ( externalModulePath) . intern ( ) ) ,
32
+ isFramework: externalModuleDetails. isFramework)
33
33
let newInfo = ModuleInfo ( modulePath: TextualVirtualPath ( path: VirtualPath . absolute ( externalModulePath) . intern ( ) ) ,
34
34
sourceFiles: [ ] ,
35
35
directDependencies: currentInfo. directDependencies,
36
+ linkLibraries: currentInfo. linkLibraries,
36
37
details: . swiftPrebuiltExternal( newExternalModuleDetails) )
37
38
Self . replaceModule ( originalId: swiftModuleId, replacementId: prebuiltModuleId,
38
39
replacementInfo: newInfo, in: & modules)
39
40
} else if let currentPrebuiltInfo = modules [ prebuiltModuleId] {
40
41
// Just update the isFramework bit on this prebuilt module dependency
41
42
let newExternalModuleDetails =
42
- try SwiftPrebuiltExternalModuleDetails ( compiledModulePath:
43
- TextualVirtualPath ( path: VirtualPath . absolute ( externalModulePath) . intern ( ) ) ,
44
- isFramework: externalModuleDetails. isFramework)
43
+ SwiftPrebuiltExternalModuleDetails ( compiledModulePath:
44
+ TextualVirtualPath ( path: VirtualPath . absolute ( externalModulePath) . intern ( ) ) ,
45
+ isFramework: externalModuleDetails. isFramework)
45
46
let newInfo = ModuleInfo ( modulePath: TextualVirtualPath ( path: VirtualPath . absolute ( externalModulePath) . intern ( ) ) ,
46
47
sourceFiles: [ ] ,
47
48
directDependencies: currentPrebuiltInfo. directDependencies,
49
+ linkLibraries: currentPrebuiltInfo. linkLibraries,
48
50
details: . swiftPrebuiltExternal( newExternalModuleDetails) )
49
51
Self . replaceModule ( originalId: prebuiltModuleId, replacementId: prebuiltModuleId,
50
52
replacementInfo: newInfo, in: & modules)
@@ -231,6 +233,9 @@ extension InterModuleDependencyGraph {
231
233
let firstModuleDependencies = firstInfo. directDependencies ?? [ ]
232
234
let secondModuleDependencies = secondInfo. directDependencies ?? [ ]
233
235
let combinedDependencies = Array ( Set ( firstModuleDependencies + secondModuleDependencies) )
236
+ let firstLinkLibraries = firstInfo. linkLibraries ?? [ ]
237
+ let secondLinkLibraries = secondInfo. linkLibraries ?? [ ]
238
+ let combinedLinkLibraries = Array ( Set ( firstLinkLibraries + secondLinkLibraries) )
234
239
235
240
let firstModuleCapturedPCMArgs = firstDetails. capturedPCMArgs ?? Set < [ String ] > ( )
236
241
let secondModuleCapturedPCMArgs = secondDetails. capturedPCMArgs ?? Set < [ String ] > ( )
@@ -245,6 +250,7 @@ extension InterModuleDependencyGraph {
245
250
return ModuleInfo ( modulePath: firstInfo. modulePath,
246
251
sourceFiles: combinedSourceFiles,
247
252
directDependencies: combinedDependencies,
253
+ linkLibraries: combinedLinkLibraries,
248
254
details: . clang( combinedModuleDetails) )
249
255
}
250
256
}
0 commit comments