forked from biscuitehh/pam-watchid
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert script to Swift Package Manager library (#5)
* Convert to Swift Package Manager module * Update Makefile to use SPM build This also avoids the incredibly cursed SDK parsing * Switch from a Swift version check to a module import check The check for the Swift 6.0 compiler was trying to do the same thing (ensure that the 15.0 SDK or newer was in use before compiling code that would error on earlier SDKs), but there were niche situations where it would not work. Thanks to <https://marcoeidinger.github.io/appleframeworks/>, I have found a framework (CoreHID) that only exists in the 15.0 SDK or newer, so I have switched to checking if that module can be imported. * Use Swift's ability to create a universal binary * Restore legacy build in Makefile * fix makefile --------- Co-authored-by: Logicer <[email protected]>
- Loading branch information
Showing
4 changed files
with
36 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
*.swp | ||
*.swo | ||
._* | ||
/.build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// swift-tools-version:5.1 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "pam-watchid", | ||
platforms: [.macOS(.v10_15)], | ||
products: [ | ||
// Products define the executables and libraries a package produces, making them visible to other packages. | ||
.library( | ||
name: "pam-watchid", | ||
type: .dynamic, | ||
targets: ["pam-watchid"]), | ||
], | ||
targets: [ | ||
// Targets are the basic building blocks of a package, defining a module or a test suite. | ||
// Targets can depend on other targets in this package and products from dependencies. | ||
.target( | ||
name: "pam-watchid"), | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters