Skip to content

[cmake] Add support for checking if we have a host toolchain Swift compiler #37511

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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,17 @@ set(CMAKE_CXX_EXTENSIONS NO)
include(SwiftUtils)
include(CheckSymbolExists)
include(CMakeDependentOption)
include(CheckLanguage)

# Enable Swift for the host compiler build if we have the language. It is
# optional until we have a bootstrap story.
check_language(Swift)
if(CMAKE_Swift_COMPILER)
enable_language(Swift)
else()
message(STATUS "WARNING! Did not find a host compiler swift?! Can not build
any compiler host sources written in Swift")
Comment on lines +62 to +63
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
message(STATUS "WARNING! Did not find a host compiler swift?! Can not build
any compiler host sources written in Swift")
message(WARNING "Did not find a host compiler swift. Can not build any compiler host sources written in Swift")

Copy link
Member

Choose a reason for hiding this comment

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

I think it may be nice to sink this lower to the point of use.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mind if I do that in a follow on?

endif()

#
# User-configurable options that control the inclusion and default build
Expand Down