[xcodegen] Allow swift-plugin-server to be added

Previously we would avoid adding this since it has
an invalid module name, but we can follow the same
logic as the driver and set the module name to
`main`.
This commit is contained in:
Hamish Knight
2024-12-15 18:29:04 +00:00
parent 1d1b260c8f
commit a7b34855ed
2 changed files with 10 additions and 3 deletions

View File

@@ -557,8 +557,10 @@ fileprivate final class ProjectGenerator {
applySubstitutions(to: &buildArgs, target: target, targetInfo: targetInfo)
// Follow the same logic as swift-driver and set the module name to 'main'
// if we don't have one.
let moduleName = buildArgs.takePrintedLastValue(for: .moduleName)
buildSettings.common.PRODUCT_MODULE_NAME = moduleName
buildSettings.common.PRODUCT_MODULE_NAME = moduleName ?? "main"
// Emit a module if we need to.
// TODO: This currently just uses the build rule command args, should we