@@ -149,11 +149,17 @@ SwiftModuleScanner::scanInterfaceFile(Twine moduleInterfacePath,
149
149
llvm::SmallString<32 > modulePath = realModuleName.str ();
150
150
llvm::sys::path::replace_extension (modulePath, newExt);
151
151
std::optional<ModuleDependencyInfo> Result;
152
- std::error_code code = astDelegate.runInSubContext (
152
+ std::error_code code = astDelegate.runInSubCompilerInstance (
153
153
realModuleName.str (), moduleInterfacePath.str (), sdkPath,
154
- StringRef (), SourceLoc (),
155
- [&](ASTContext &Ctx, ModuleDecl *mainMod, ArrayRef<StringRef> BaseArgs,
156
- ArrayRef<StringRef> PCMArgs, StringRef Hash) {
154
+ StringRef (), SourceLoc (), /* silenceErrors=*/ false ,
155
+ [&](SubCompilerInstanceInfo &info) {
156
+ ASTContext &Ctx = info.Instance ->getASTContext ();
157
+ ModuleDecl *mainMod = info.Instance ->getMainModule ();
158
+ ArrayRef<StringRef> BaseArgs = info.BuildArguments ;
159
+ ArrayRef<StringRef> PCMArgs = info.ExtraPCMArgs ;
160
+ StringRef Hash = info.Hash ;
161
+ const CompilerInvocation &Invocation = info.Instance ->getInvocation ();
162
+
157
163
assert (mainMod);
158
164
std::string InPath = moduleInterfacePath.str ();
159
165
auto compiledCandidates =
@@ -241,6 +247,12 @@ SwiftModuleScanner::scanInterfaceFile(Twine moduleInterfacePath,
241
247
isFramework ? LibraryKind::Framework : LibraryKind::Library,
242
248
true });
243
249
}
250
+
251
+ // Register libraries specified by `-public-autolink-library`
252
+ for (auto publicLinkLibrary : Invocation.getIRGenOptions ().PublicLinkLibraries ) {
253
+ linkLibraries.push_back (LinkLibrary (publicLinkLibrary, LibraryKind::Library));
254
+ }
255
+
244
256
bool isStatic = llvm::find (ArgsRefs, " -static" ) != ArgsRefs.end ();
245
257
246
258
Result = ModuleDependencyInfo::forSwiftInterfaceModule (
0 commit comments