Skip to content

[cmake] Include StdlibOptions when only building toolchain extras. #41942

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

Merged
merged 1 commit into from
Mar 23, 2022

Conversation

drodriguez
Copy link
Contributor

In #40610 some options were moved into StdlibOptions.cmake, but that
file is only included from stdlib/CMakeLists.txt and
cmake/modules/StandaloneOverlay.cmake. However, if one does not build
neither the dynamic nor the static standard library, but enables
building the "toolchain extras" with
SWIFT_BUILD_STDLIB_EXTRA_TOOLCHAIN_CONTENT stdlib/CMakeLists.txt
will not be included, but stdlib/toolchain/CMakeLists.txt will, which
uses a value from StandardOverlay.cmake that will not be provided the
correct default value and will skip building most of what
SWIFT_BUILD_STDLIB_EXTRA_TOOLCHAIN_CONTENT used to do.

In swiftlang#40610 some options were moved into `StdlibOptions.cmake`, but that
file is only included from `stdlib/CMakeLists.txt` and
`cmake/modules/StandaloneOverlay.cmake`. However, if one does not build
neither the dynamic nor the static standard library, but enables
building the "toolchain extras" with
`SWIFT_BUILD_STDLIB_EXTRA_TOOLCHAIN_CONTENT` `stdlib/CMakeLists.txt`
will not be included, but `stdlib/toolchain/CMakeLists.txt` will, which
uses a value from `StandardOverlay.cmake` that will not be provided the
correct default value and will skip building most of what
`SWIFT_BUILD_STDLIB_EXTRA_TOOLCHAIN_CONTENT` used to do.
@drodriguez
Copy link
Contributor Author

drodriguez commented Mar 21, 2022

An alternative solution might be replicating what #39816 did for other variable.

It can also happen that some other directory from https://github.com/apple/swift/blob/5fbd9b425402e9a66eda69c465e4673bfabfb3bb/CMakeLists.txt#L1107-L1122 uses those variables (directly or indirectly) and needs a similar fix to this. I haven't found those problems, so I did not change those directories.

@drodriguez
Copy link
Contributor Author

@swift-ci please test

@compnerd
Copy link
Member

@swift-ci please test Windows platform

@drodriguez drodriguez merged commit e2d6f5a into swiftlang:main Mar 23, 2022
@drodriguez drodriguez deleted the swift-build-extra-toolchain branch March 23, 2022 16:32
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