Skip to content

[5.1] [CMake] Switch to building the overlays in Swift 5 mode #24388

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
Apr 30, 2019
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion cmake/modules/SwiftSource.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ function(_compile_swift_files

# Force swift 4 compatibility mode for overlays.
if (SWIFTFILE_IS_SDK_OVERLAY)
list(APPEND swift_flags "-swift-version" "4")
list(APPEND swift_flags "-swift-version" "5")
endif()

if(SWIFTFILE_IS_SDK_OVERLAY)
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/Darwin/AppKit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ add_swift_target_library(swiftAppKit ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS
NSGraphics.swift
NSOpenGL.swift

SWIFT_COMPILE_FLAGS ${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS} -swift-version 4
SWIFT_COMPILE_FLAGS ${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"
TARGET_SDKS OSX
SWIFT_MODULE_DEPENDS_OSX Darwin CoreData CoreGraphics CoreImage Dispatch Foundation IOKit ObjectiveC QuartzCore XPC # auto-updated
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/Darwin/CloudKit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ add_swift_target_library(swiftCloudKit ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES}
CKRecordValue.swift
DefaultParameters.swift

SWIFT_COMPILE_FLAGS "${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}" "-swift-version" "4.2"
SWIFT_COMPILE_FLAGS "${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}"
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"
TARGET_SDKS OSX IOS IOS_SIMULATOR TVOS TVOS_SIMULATOR WATCHOS WATCHOS_SIMULATOR

Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/Darwin/CoreImage/CoreImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extension CIFilter {
for (key, value) in elements {
dict[key] = value
}
self.init(name: name, withInputParameters: dict)
self.init(name: name, parameters: dict)
}
}

Expand Down
6 changes: 3 additions & 3 deletions stdlib/public/Darwin/CoreMedia/CMTime.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@

extension CMTime {
public init(seconds: Double, preferredTimescale: CMTimeScale) {
self = CMTimeMakeWithSeconds(seconds, preferredTimescale)
self = CMTimeMakeWithSeconds(seconds, preferredTimescale: preferredTimescale)
}

public init(value: CMTimeValue, timescale: CMTimeScale) {
self = CMTimeMake(value, timescale)
self = CMTimeMake(value: value, timescale: timescale)
}
}

Expand Down Expand Up @@ -67,7 +67,7 @@ extension CMTime {

public func convertScale(_ newTimescale: Int32, method: CMTimeRoundingMethod)
-> CMTime {
return CMTimeConvertScale(self, newTimescale, method)
return CMTimeConvertScale(self, timescale: newTimescale, method: method)
}
}

Expand Down
12 changes: 6 additions & 6 deletions stdlib/public/Darwin/CoreMedia/CMTimeRange.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
// CMTimeRangeFromTimeToTime
extension CMTimeRange {
public init(start: CMTime, end: CMTime) {
self = CMTimeRangeFromTimeToTime(start, end)
self = CMTimeRangeFromTimeToTime(start: start, end: end)
}

public var isValid: Bool {
Expand All @@ -40,24 +40,24 @@ extension CMTimeRange {
}

public var isEmpty: Bool {
return self.isValid && (self.duration == kCMTimeZero)
return self.isValid && (self.duration == .zero)
}

public var end: CMTime {
return CMTimeRangeGetEnd(self)
}

public func union(_ otherRange: CMTimeRange) -> CMTimeRange {
return CMTimeRangeGetUnion(self, otherRange)
return CMTimeRangeGetUnion(self, otherRange: otherRange)
}
public func intersection(_ otherRange: CMTimeRange) -> CMTimeRange {
return CMTimeRangeGetIntersection(self, otherRange)
return CMTimeRangeGetIntersection(self, otherRange: otherRange)
}
public func containsTime(_ time: CMTime) -> Bool {
return CMTimeRangeContainsTime(self, time)
return CMTimeRangeContainsTime(self, time: time)
}
public func containsTimeRange(_ range: CMTimeRange) -> Bool {
return CMTimeRangeContainsTimeRange(self, range)
return CMTimeRangeContainsTimeRange(self, otherRange: range)
}
}

Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/Darwin/Foundation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ add_swift_target_library(swiftFoundation ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES
UUID.swift
CheckClass.mm

SWIFT_COMPILE_FLAGS "${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}" "-Xllvm" "-sil-inline-generics" "-Xllvm" "-sil-partial-specialization" "-swift-version" "5"
SWIFT_COMPILE_FLAGS "${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}" "-Xllvm" "-sil-inline-generics" "-Xllvm" "-sil-partial-specialization"
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"

SWIFT_MODULE_DEPENDS_OSX Darwin CoreFoundation CoreGraphics Dispatch IOKit ObjectiveC # auto-updated
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/Darwin/UIKit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ add_swift_target_library(swiftUIKit ${SWIFT_SDK_OVERLAY_LIBRARY_BUILD_TYPES} IS_
UIKit.swift
UIKit_FoundationExtensions.swift.gyb

SWIFT_COMPILE_FLAGS ${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS} -swift-version 4.2
SWIFT_COMPILE_FLAGS ${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"
TARGET_SDKS IOS IOS_SIMULATOR TVOS TVOS_SIMULATOR WATCHOS WATCHOS_SIMULATOR
SWIFT_MODULE_DEPENDS_IOS Darwin CoreFoundation CoreGraphics CoreImage Dispatch Foundation ObjectiveC QuartzCore os # auto-updated
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/Darwin/UIKit/UIKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ internal struct _UIViewQuickLookState {
static var views = Set<UIView>()
}

extension UIView : _DefaultCustomPlaygroundQuickLookable {
extension UIView : __DefaultCustomPlaygroundQuickLookable {
@available(*, deprecated, message: "UIView._defaultCustomPlaygroundQuickLook will be removed in a future Swift version")
public var _defaultCustomPlaygroundQuickLook: PlaygroundQuickLook {
if _UIViewQuickLookState.views.contains(self) {
Expand Down