Skip to content

Commit a2d6ddf

Browse files
committed
SwiftWin32: further adopt static libraries on 5.7+
Swift 5.7.0 enables static libraries for non-standard library cases. Use this to extract the CoreGraphics interfaces out of the primary library.
1 parent e648af7 commit a2d6ddf

File tree

59 files changed

+266
-32
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+266
-32
lines changed

Examples/Calculator/Calculator.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
import SwiftWin32
55
import Foundation
66

7+
#if swift(>=5.7)
8+
import CoreGraphics
9+
#endif
10+
711
private extension View {
812
func addSubviews(_ views: [View]) {
913
_ = views.map { self.addSubview($0) }

Examples/UICatalog/UICatalog.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ import func WinSDK.MessageBoxW
88
import let WinSDK.MB_OK
99
import struct WinSDK.UINT
1010

11+
#if swift(>=5.7)
12+
import CoreGraphics
13+
#endif
14+
1115
private extension Label {
1216
convenience init(frame: Rect, title: String) {
1317
self.init(frame: frame)

Package.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,24 @@ let SwiftWin32: Package =
2727
targets: [
2828
.target(name: "CoreAnimation",
2929
path: "Sources/SwiftWin32/CoreAnimation"),
30+
.target(name: "CoreGraphics",
31+
path: "Sources/SwiftWin32/CoreGraphics"),
3032
.target(name: "SwiftWin32",
3133
dependencies: [
3234
"CoreAnimation",
35+
"CoreGraphics",
3336
.product(name: "Logging", package: "swift-log"),
3437
.product(name: "OrderedCollections",
3538
package: "swift-collections"),
3639
.product(name: "cassowary", package: "cassowary"),
3740
.product(name: "SwiftCOM", package: "swift-com"),
3841
],
3942
path: "Sources/SwiftWin32",
40-
exclude: ["CoreAnimation", "CMakeLists.txt"],
43+
exclude: [
44+
"CoreAnimation",
45+
"CoreGraphics",
46+
"CMakeLists.txt"
47+
],
4148
swiftSettings: [
4249
.enableExperimentalFeature("AccessLevelOnImport"),
4350
],
@@ -76,7 +83,7 @@ let SwiftWin32: Package =
7683
]),
7784
.target(name: "TestUtilities", path: "Tests/Utilities"),
7885
.testTarget(name: "AutoLayoutTests", dependencies: ["SwiftWin32"]),
79-
.testTarget(name: "CoreGraphicsTests", dependencies: ["SwiftWin32"]),
86+
.testTarget(name: "CoreGraphicsTests", dependencies: ["CoreGraphics"]),
8087
.testTarget(name: "SupportTests", dependencies: ["SwiftWin32"]),
8188
.testTarget(name: "UICoreTests",
8289
dependencies: ["SwiftWin32", "TestUtilities"])

[email protected]

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,24 @@ let SwiftWin32: Package =
2727
targets: [
2828
.target(name: "CoreAnimation",
2929
path: "Sources/SwiftWin32/CoreAnimation"),
30+
.target(name: "CoreGraphics",
31+
path: "Sources/SwiftWin32/CoreGraphics"),
3032
.target(name: "SwiftWin32",
3133
dependencies: [
3234
"CoreAnimation",
35+
"CoreGraphics",
3336
.product(name: "Logging", package: "swift-log"),
3437
.product(name: "OrderedCollections",
3538
package: "swift-collections"),
3639
.product(name: "cassowary", package: "cassowary"),
3740
.product(name: "SwiftCOM", package: "swift-com"),
3841
],
3942
path: "Sources/SwiftWin32",
40-
exclude: ["CoreAnimation", "CMakeLists.txt"],
43+
exclude: [
44+
"CoreAnimation",
45+
"CoreGraphics",
46+
"CMakeLists.txt",
47+
],
4148
linkerSettings: [
4249
.linkedLibrary("User32"),
4350
.linkedLibrary("ComCtl32"),
@@ -73,7 +80,7 @@ let SwiftWin32: Package =
7380
]),
7481
.target(name: "TestUtilities", path: "Tests/Utilities"),
7582
.testTarget(name: "AutoLayoutTests", dependencies: ["SwiftWin32"]),
76-
.testTarget(name: "CoreGraphicsTests", dependencies: ["SwiftWin32"]),
83+
.testTarget(name: "CoreGraphicsTests", dependencies: ["CoreGraphics"]),
7784
.testTarget(name: "SupportTests", dependencies: ["SwiftWin32"]),
7885
.testTarget(name: "UICoreTests",
7986
dependencies: ["SwiftWin32", "TestUtilities"])

Sources/SwiftWin32/Animation and Haptics/Property-Based Animations/CubicTimingParameters.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// Copyright © 2021 Saleem Abdulrasool <[email protected]>
22
// SPDX-License-Identifier: BSD-3-Clause
33

4+
#if swift(>=5.7)
5+
import CoreGraphics
6+
#endif
7+
48
/// The timing information for animations in the form of a cubic Bézier curve.
59
public class CubicTimingParameters {
610
// MARK - Initializing a Cubic Timing Parameters Object

Sources/SwiftWin32/Animation and Haptics/Property-Based Animations/SpringTimingParameters.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// Copyright © 2021 Saleem Abdulrasool <[email protected]>
22
// SPDX-License-Identifier: BSD-3-Clause
33

4+
#if swift(>=5.7)
5+
import CoreGraphics
6+
#endif
7+
48
/// The timing information for animations that mimics the behavior of a spring.
59
public class SpringTimingParameters {
610
// MARK - Initializing a Spring Timing Parameters Object

Sources/SwiftWin32/Animation and Haptics/View Controller Transitions/ViewControllerTransitionCoordinatorContext.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
import struct Foundation.TimeInterval
55

6+
#if swift(>=5.7)
7+
import CoreGraphics
8+
#endif
9+
610
/// Modal presentation styles available when presenting view controllers.
711
public enum ModalPresentationStyle: Int {
812
/// The default presentation style chosen by the system.

Sources/SwiftWin32/Animation and Haptics/ViewControllerContextTransitioning.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// Copyright © 2021 Saleem Abdulrasool <[email protected]>
22
// SPDX-License-Identifier: BSD-3-Clause
33

4+
#if swift(>=5.7)
5+
import CoreGraphics
6+
#endif
7+
48
/// The keys you use to identify the view controllers involved in a transition.
59
public struct TransitionContextViewControllerKey: Equatable, Hashable, RawRepresentable {
610
public typealias RawValue = String

Sources/SwiftWin32/Appearance Customization/Configurations/ListContentConfiguration.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
import class Foundation.NSAttributedString
55

6+
#if swift(>=5.7)
7+
import CoreGraphics
8+
#endif
9+
610
extension ListContentConfiguration {
711
/// Properties that affect the list content configuration's image.
812
public struct ImageProperties {

Sources/SwiftWin32/AutoLayout/LayoutGuide.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// Copyright © 2020 Saleem Abdulrasool <[email protected]>.
22
// SPDX-License-Identifier: BSD-3-Clause
33

4+
#if swift(>=5.7)
5+
import CoreGraphics
6+
#endif
7+
48
public class LayoutGuide {
59
// MARK - Working with Layout Guides
610

0 commit comments

Comments
 (0)