Skip to content

Conversation

daveinglis
Copy link
Contributor

  • the native builder only enables clang modules on Darwin, so we will need to do the same with swift-build.

- the native builder only enables clang modules on Darwin, so we will
  need to do the same with swift-build.
@daveinglis
Copy link
Contributor Author

@swift-ci test


func configureProjectBuildSettings(_ buildSettings: inout ProjectModel.BuildSettings) {
/* empty */
// This is parity to the native build, But we should investigate what it would take to get this working on platforms.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of checking the current platform in BuildParameters, we should use platform conditionals here so that the PIF remains platform-agnostic. The subscript on buildSettings has a for parameter you can use to add platform conditions

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably try at some point to avoid giving the PIF builder access to build parameters to help prevent this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. The package model will likely need enhancement so that we can properly express all the conditionals users will need, especially around platforms, but that's in the works.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed that using the platform conditions is okay for now:

buildSettings.platformSpecificSettings[.linux]![.FOO] = "bar"

Copy link
Contributor

@pmattos pmattos Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Why are we doing this in the PIF delegate implementation for SwiftPM? To be clear, we should reserve the delegate for SwiftPM only patches.

If this is a general patch (eg, Xcode, etc) we should hardcode it in PackagePIFBuilder.addProjectBuildSettings instead. For instance, Xcode has it's own independent PackagePIFBuilder.BuildDelegate implementation and, as such, won't inherit such configuration as is.

}

settings[.USE_HEADERMAP] = "NO"
settings[.OTHER_SWIFT_FLAGS].lazilyInitializeAndMutate(initialValue: ["$(inherited)"]) { $0.append("-DXcode") }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should address this separately and conditionalize it on a new field in the PIFBuilderParameters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants