Skip to content

Commit 8428b36

Browse files
Merge pull request #74277 from kateinoigakukun/katei/save-public-autolink-library-interface
[ModuleInterface] Save `-public-autolink-library` module option
2 parents f1a8875 + 6a11171 commit 8428b36

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

include/swift/Option/FrontendOptions.td

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,6 @@ def no_serialize_debugging_options :
207207
def autolink_library : Separate<["-"], "autolink-library">,
208208
HelpText<"Add dependent library">, Flags<[FrontendOption]>;
209209

210-
def public_autolink_library : Separate<["-"], "public-autolink-library">,
211-
HelpText<"Add public dependent library">, Flags<[FrontendOption]>;
212-
213210
def disable_typo_correction : Flag<["-"], "disable-typo-correction">,
214211
HelpText<"Disable typo correction">;
215212

@@ -369,6 +366,10 @@ def enable_resilience : Flag<["-"], "enable-resilience">,
369366
def enable_experimental_async_top_level :
370367
Flag<["-"], "enable-experimental-async-top-level">,
371368
HelpText<"Enable experimental concurrency in top-level code">;
369+
370+
def public_autolink_library :
371+
Separate<["-"], "public-autolink-library">,
372+
HelpText<"Add public dependent library">;
372373
}
373374

374375
// HIDDEN FLAGS

lib/Frontend/ModuleInterfaceBuilder.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ std::error_code ExplicitModuleInterfaceBuilder::buildSwiftModuleFromInterface(
276276
SerializationOpts.ModuleLinkName = FEOpts.ModuleLinkName;
277277
SerializationOpts.AutolinkForceLoad =
278278
!Invocation.getIRGenOptions().ForceLoadSymbolName.empty();
279+
SerializationOpts.PublicDependentLibraries =
280+
Invocation.getIRGenOptions().PublicLinkLibraries;
279281
SerializationOpts.UserModuleVersion = FEOpts.UserModuleVersion;
280282
SerializationOpts.AllowableClients = FEOpts.AllowableClients;
281283
StringRef SDKPath = Instance.getASTContext().SearchPathOpts.getSDKPath();
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-swift-frontend -typecheck -module-name Foo -emit-module-interface-path %t/Foo.swiftinterface %s -module-link-name Foo -enable-library-evolution -public-autolink-library Bar
3+
// RUN: %target-swift-frontend -compile-module-from-interface -o %t/Foo.swiftmodule %t/Foo.swiftinterface
4+
// RUN: %target-swift-ide-test -print-module-metadata -module-to-print Foo -I %t -source-filename %s | %FileCheck %s
5+
6+
// CHECK: link library: Bar

0 commit comments

Comments
 (0)