Add Single Module Build Mode to CMake for Foundation #385
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds two new options to the CMake build:
COLLECTIONS_SINGLE_MODULE
andCOLLECTIONS_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 toFoundationEssentials
. 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 withCOLLECTIONS_FOUNDATION_TOOLCHAIN_MODULE
creates a single library that is statically linked intoFoundationEssentials
and installs just the swift module in the appropriate location.Checklist