Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 778e896

Browse files
committed
SwiftWin32: silence warning on recent development compilers
Use the newly minted support for access control on imports (SE-0409) to clean up some newer warnings.
1 parent 9275ac3 commit 778e896

File tree

5 files changed

+93
-1
lines changed

5 files changed

+93
-1
lines changed

‎Package.swift‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.7
1+
// swift-tools-version:5.9
22

33
import PackageDescription
44

@@ -38,6 +38,9 @@ let SwiftWin32: Package =
3838
],
3939
path: "Sources/SwiftWin32",
4040
exclude: ["CoreAnimation", "CMakeLists.txt"],
41+
swiftSettings: [
42+
.enableExperimentalFeature("AccessLevelOnImport"),
43+
],
4144
linkerSettings: [
4245
.linkedLibrary("User32"),
4346
.linkedLibrary("ComCtl32"),

‎Package@swift-5.7.swift‎

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
// swift-tools-version:5.7
2+
3+
import PackageDescription
4+
5+
let SwiftWin32: Package =
6+
Package(name: "SwiftWin32",
7+
products: [
8+
.library(name: "SwiftWin32",
9+
type: .dynamic,
10+
targets: ["SwiftWin32"]),
11+
.library(name: "SwiftWin32UI",
12+
type: .dynamic,
13+
targets: ["SwiftWin32UI"]),
14+
.executable(name: "UICatalog", targets: ["UICatalog"]),
15+
.executable(name: "Calculator", targets: ["Calculator"]),
16+
],
17+
dependencies: [
18+
.package(url: "https://github.com/apple/swift-log.git",
19+
.upToNextMajor(from: "1.4.3")),
20+
.package(url: "https://github.com/apple/swift-collections.git",
21+
.upToNextMinor(from: "1.0.0")),
22+
.package(url: "https://github.com/compnerd/cassowary.git",
23+
branch: "main"),
24+
.package(url: "https://github.com/compnerd/swift-com.git",
25+
revision: "ebbc617d3b7ba3a2023988a74bebd118deea4cc5"),
26+
],
27+
targets: [
28+
.target(name: "CoreAnimation",
29+
path: "Sources/SwiftWin32/CoreAnimation"),
30+
.target(name: "SwiftWin32",
31+
dependencies: [
32+
"CoreAnimation",
33+
.product(name: "Logging", package: "swift-log"),
34+
.product(name: "OrderedCollections",
35+
package: "swift-collections"),
36+
.product(name: "cassowary", package: "cassowary"),
37+
.product(name: "SwiftCOM", package: "swift-com"),
38+
],
39+
path: "Sources/SwiftWin32",
40+
exclude: ["CoreAnimation", "CMakeLists.txt"],
41+
linkerSettings: [
42+
.linkedLibrary("User32"),
43+
.linkedLibrary("ComCtl32"),
44+
]),
45+
.target(name: "SwiftWin32UI",
46+
dependencies: ["SwiftWin32"],
47+
path: "Sources/SwiftWin32UI",
48+
exclude: ["CMakeLists.txt"]),
49+
.executableTarget(name: "Calculator",
50+
dependencies: ["SwiftWin32"],
51+
path: "Examples/Calculator",
52+
exclude: [
53+
"CMakeLists.txt",
54+
"Calculator.exe.manifest",
55+
"Info.plist",
56+
],
57+
swiftSettings: [
58+
.unsafeFlags(["-parse-as-library"])
59+
]),
60+
.executableTarget(name: "UICatalog",
61+
dependencies: ["SwiftWin32"],
62+
path: "Examples/UICatalog",
63+
exclude: [
64+
"CMakeLists.txt",
65+
"Info.plist",
66+
"UICatalog.exe.manifest",
67+
],
68+
resources: [
69+
.copy("Assets/CoffeeCup.jpg")
70+
],
71+
swiftSettings: [
72+
.unsafeFlags(["-parse-as-library"])
73+
]),
74+
.target(name: "TestUtilities", path: "Tests/Utilities"),
75+
.testTarget(name: "AutoLayoutTests", dependencies: ["SwiftWin32"]),
76+
.testTarget(name: "CoreGraphicsTests", dependencies: ["SwiftWin32"]),
77+
.testTarget(name: "SupportTests", dependencies: ["SwiftWin32"]),
78+
.testTarget(name: "UICoreTests",
79+
dependencies: ["SwiftWin32", "TestUtilities"])
80+
])

‎Package@swift-5.8.swift‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Package@swift-5.7.swift

‎Sources/SwiftWin32/Platform/Win32+Menu.swift‎

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

44
import WinSDK
55

6+
#if swift(>=5.9)
7+
internal import OrderedCollections
8+
#else
69
@_implementationOnly
710
import OrderedCollections
11+
#endif
812

913
internal final class _MenuBuilder: MenuSystem {
1014
internal private(set) var hMenu: MenuHandle
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
// Copyright © 2020 Saleem Abdulrasool <compnerd@compnerd.org>
22
// SPDX-License-Identifier: BSD-3-Clause
33

4+
#if swift(>=5.9)
5+
internal import Logging
6+
#else
47
@_implementationOnly
58
import Logging
9+
#endif
610

711
internal let log: Logger = Logger(label: "org.compnerd.swift-win32")

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /