-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Concurrency][Stdlib] Add SwiftStdlibCurrentOS availability, use it. #81440
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
Changes from 1 commit
28f96e6
cd7701c
c749e64
7e318e2
d110464
467f401
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -36,3 +36,26 @@ if(NOT SwiftCore_ARCH_SUBDIR) | |||
|
||||
message(CONFIGURE_LOG "Swift Arch: ${arch}") | ||||
endif() | ||||
|
||||
if(NOT SwiftCore_SWIFT_AVAILABILITY_PLATFORM) | ||||
set(availability_platform_macosx "macOS") | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't love this bit. We're trying to get away from the hard-coded hand-maintained tables. I wonder if there is any way we could embed it into the existing availability macro file? Maybe this is something we can embed in cache files? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CPP to generate a response file would be my recommendation. I think that we were already doing that somewhere? (Perhaps the new build system?) |
||||
set(availability_platform_ios "iOS") | ||||
set(availability_platform_watchos "watchOS") | ||||
set(availability_platform_tvos "tvOS") | ||||
set(availability_platform_xros "visionOS") | ||||
set(availability_platform_bridgeos "bridgeOS") | ||||
|
||||
if(SwiftCore_SWIFT_MODULE_TRIPLE MATCHES ".*-([^-]+)-simulator$") | ||||
set(platform "${CMAKE_MATCH_1}") | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you should be able to get this information from the
|
||||
elseif(SwiftCore_SWIFT_MODULE_TRIPLE MATCHES ".*-([^-]+)$") | ||||
set(platform "${CMAKE_MATCH_1}") | ||||
else() | ||||
message(ERROR "Unable to extract platform name from triple ${SwiftCore_SWIFT_MODULE_TRIPLE}") | ||||
endif() | ||||
|
||||
if(availability_platform_${platform}) | ||||
set(SwiftCore_SWIFT_AVAILABILITY_PLATFORM "${availability_platform_${platform}}") | ||||
else() | ||||
message(ERROR "Unknown platform ${platform} for availability") | ||||
endif() | ||||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AvailabilityMacros.cmake is loaded before platform info, so
SwiftCore_SWIFT_AVAILABILITY_PLATFORM
won't be set by that here.