Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Single Module Build Mode to CMake for Foundation #385

Merged

Conversation

jmschonfeld
Copy link
Contributor

This adds two new options to the CMake build: COLLECTIONS_SINGLE_MODULE and COLLECTIONS_FOUNDATION_TOOLCHAIN_MODULE. The former builds the project into one single module and mimics the setup for this mode that the package manifest provides. The later implies a single module and additionally renames the module to _FoundationCollections, adds the rope module's sources to the combined module, and limits the allowed client of the module to FoundationEssentials. This work is in order to support building swift-foundation (which depends on swift-collections) as part of the toolchain.

The cmake files are only used by the toolchain build, but I've validated locally that building a linux toolchain with swift-foundation (which will invoke this cmake build both with and without COLLECTIONS_FOUNDATION_TOOLCHAIN_MODULE) successfully creates a toolchain and that the version with COLLECTIONS_FOUNDATION_TOOLCHAIN_MODULE creates a single library that is statically linked into FoundationEssentials and installs just the swift module in the appropriate location.

Checklist

  • I've read the Contribution Guidelines
  • My contributions are licensed under the Swift license.
  • I've followed the coding style of the rest of the project.
  • I've added tests covering all new code paths my change adds to the project (if appropriate).
  • I've added benchmarks covering new functionality (if appropriate).
  • I've verified that my change does not break any existing tests or introduce unexplained benchmark regressions.
  • I've updated the documentation if necessary.

Copy link
Member

@lorentey lorentey left a comment

Choose a reason for hiding this comment

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

Looks good!

@jmschonfeld jmschonfeld merged commit ee97538 into apple:release/1.1 Jun 3, 2024
@jmschonfeld jmschonfeld deleted the foundation-toolchain-cmake branch June 3, 2024 23:16
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.

2 participants