diff --git a/Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift b/Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift index 338f78172..d7951803f 100644 --- a/Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift +++ b/Sources/SwiftDriver/Jobs/FrontendJobHelpers.swift @@ -287,6 +287,12 @@ extension Driver { .experimentalClangImporterDirectCc1Scan, from: &parsedOptions) } + if isFrontendArgSupported(.packageAvailableModules) { + try commandLine.appendAll(.packageManifest, from: &parsedOptions) + try commandLine.appendAll(.packageTargetName, from: &parsedOptions) + try commandLine.appendAll(.packageAvailableModules, from: &parsedOptions) + } + // Expand the -experimental-hermetic-seal-at-link flag if parsedOptions.hasArgument(.experimentalHermeticSealAtLink) { commandLine.appendFlag("-enable-llvm-vfe") diff --git a/Sources/SwiftOptions/Options.swift b/Sources/SwiftOptions/Options.swift index 71ce912ff..fa6263924 100644 --- a/Sources/SwiftOptions/Options.swift +++ b/Sources/SwiftOptions/Options.swift @@ -642,8 +642,11 @@ extension Option { public static let outputFilelist: Option = Option("-output-filelist", .separate, attributes: [.frontend, .noDriver, .cacheInvariant], helpText: "Specify outputs in a file rather than on the command line") public static let O: Option = Option("-O", .flag, attributes: [.frontend, .moduleInterface], helpText: "Compile with optimizations", group: .O) public static let o: Option = Option("-o", .joinedOrSeparate, attributes: [.frontend, .noInteractive, .autolinkExtract, .moduleWrap, .indent, .argumentIsPath, .cacheInvariant], metaVar: "", helpText: "Write output to ") + public static let packageAvailableModules: Option = Option("-package-available-modules", .separate, attributes: [.frontend, .doesNotAffectIncrementalBuild, .argumentIsPath], helpText: "JSON file describing the modules that are available within the enclosing package") public static let packageDescriptionVersion: Option = Option("-package-description-version", .separate, attributes: [.helpHidden, .frontend, .moduleInterface], metaVar: "", helpText: "The version number to be applied on the input for the PackageDescription availability kind") + public static let packageManifest: Option = Option("-package-manifest", .separate, attributes: [.frontend, .doesNotAffectIncrementalBuild, .argumentIsPath], helpText: "The path to the package manifest in which this source file resides") public static let packageName: Option = Option("-package-name", .separate, attributes: [.frontend, .moduleInterface], helpText: "Name of the package the module belongs to") + public static let packageTargetName: Option = Option("-package-target-name", .separate, attributes: [.frontend, .doesNotAffectIncrementalBuild], helpText: "The name of the target corresponding to this module within the enclosing package") public static let parallelScan: Option = Option("-parallel-scan", .flag, attributes: [.frontend, .noDriver], helpText: "Perform dependency scanning in-parallel.") public static let parseAsLibrary: Option = Option("-parse-as-library", .flag, attributes: [.frontend, .noInteractive], helpText: "Parse the input file(s) as libraries, not scripts") public static let parseSil: Option = Option("-parse-sil", .flag, attributes: [.frontend, .noInteractive], helpText: "Parse the input file as SIL code, not Swift source") @@ -771,7 +774,6 @@ extension Option { public static let suppressStaticExclusivitySwap: Option = Option("-suppress-static-exclusivity-swap", .flag, attributes: [.helpHidden, .frontend, .noDriver], helpText: "Suppress static violations of exclusive access with swap()") public static let suppressWarnings: Option = Option("-suppress-warnings", .flag, attributes: [.frontend], helpText: "Suppress all warnings") public static let swiftAsyncFramePointerEQ: Option = Option("-swift-async-frame-pointer=", .joined, attributes: [.helpHidden, .frontend, .noDriver], helpText: "One of 'auto', 'always' or 'never'") - public static let swiftModuleCrossImport: Option = Option("-swift-module-cross-import", .multiArg, attributes: [.frontend, .noDriver], metaVar: " ", helpText: "Specify the cross import module", numArgs: 2) public static let swiftModuleFile: Option = Option("-swift-module-file=", .joined, attributes: [.frontend, .noDriver], metaVar: "=", helpText: "Specify Swift module input explicitly built from textual interface") public static let swiftOnly: Option = Option("-swift-only", .flag, attributes: [.noDriver], helpText: "Only include APIs defined from Swift source") public static let swiftOnly_: Option = Option("--swift-only", .flag, alias: Option.swiftOnly, attributes: [.noDriver], helpText: "Only include APIs defined from Swift source") @@ -1495,8 +1497,11 @@ extension Option { Option.outputFilelist, Option.O, Option.o, + Option.packageAvailableModules, Option.packageDescriptionVersion, + Option.packageManifest, Option.packageName, + Option.packageTargetName, Option.parallelScan, Option.parseAsLibrary, Option.parseSil, @@ -1624,7 +1629,6 @@ extension Option { Option.suppressStaticExclusivitySwap, Option.suppressWarnings, Option.swiftAsyncFramePointerEQ, - Option.swiftModuleCrossImport, Option.swiftModuleFile, Option.swiftOnly, Option.swiftOnly_,