Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,12 @@ extension Driver {
// Enable or disable ObjC interop appropriately for the platform
if targetTriple.isDarwin && !isEmbeddedEnabled {
commandLine.appendFlag(.enableObjcInterop)
} else {
} else if !parsedOptions.hasArgument(.gnustepObjcInterop) {
commandLine.appendFlag(.disableObjcInterop)
}
if parsedOptions.hasArgument(.gnustepObjcInterop) {
commandLine.appendFlag(.gnustepObjcInterop)
}

// Add flags for C++ interop
try commandLine.appendLast(.enableExperimentalCxxInterop, from: &parsedOptions)
Expand Down
2 changes: 2 additions & 0 deletions Sources/SwiftOptions/Options.swift
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ extension Option {
public static let enableNskeyedarchiverDiagnostics: Option = Option("-enable-nskeyedarchiver-diagnostics", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Diagnose classes with unstable mangled names adopting NSCoding")
public static let enableObjcAttrRequiresFoundationModule: Option = Option("-enable-objc-attr-requires-foundation-module", .flag, attributes: [.helpHidden, .frontend, .noDriver, .moduleInterface], helpText: "Enable requiring uses of @objc to require importing the Foundation module")
public static let enableObjcInterop: Option = Option("-enable-objc-interop", .flag, attributes: [.helpHidden, .frontend, .noDriver, .moduleInterface], helpText: "Enable Objective-C interop code generation and config directives")
public static let gnustepObjcInterop: Option = Option("-gnustep-objc-interop", .flag, attributes: [.helpHidden, .frontend, .moduleInterface], helpText: "Enable GNUstep Objective-C interop code generation and config directives")
public static let enableObjectiveCProtocolSymbolicReferences: Option = Option("-enable-objective-c-protocol-symbolic-references", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Enable objective-c protocol symbolic references")
public static let enableOnlyOneDependencyFile: Option = Option("-enable-only-one-dependency-file", .flag, attributes: [.doesNotAffectIncrementalBuild], helpText: "Enables incremental build optimization that only produces one dependencies file")
public static let enableOssaModules: Option = Option("-enable-ossa-modules", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Obsolete. This option is ignored")
Expand Down Expand Up @@ -1535,6 +1536,7 @@ extension Option {
Option.enableNskeyedarchiverDiagnostics,
Option.enableObjcAttrRequiresFoundationModule,
Option.enableObjcInterop,
Option.gnustepObjcInterop,
Option.enableObjectiveCProtocolSymbolicReferences,
Option.enableOnlyOneDependencyFile,
Option.enableOssaModules,
Expand Down
Loading