Skip to content
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

Swift 6, SwiftUnicodeDataTables, Other Improvements #106

Merged
merged 35 commits into from
Dec 10, 2024

Conversation

STREGA
Copy link
Contributor

@STREGA STREGA commented Nov 22, 2024

  • Reworked PDCPlugin so PlaydateKit and CPlaydate are built as part of the product dependencies
  • Added simple support for C/C++ modules. Since the PDCPlugin cannot access the Package cSettings/cxxSettings this will not be that useful, but simple C/C++ code modules should work
  • Added the libSwiftUnicodeDataTables source files, directly from the SwiftLang repository, as a source target.
  • Bumped the package to Swift Language Mode v6 and the Package tools version to swift 6.
  • Fixed all Swift 6 deprecations
  • Moves helper variables in Package.swift to the bottom of the file. This change will help reduce build errors when users copy the variables from PlaydateKit to their own package.

@STREGA STREGA marked this pull request as draft November 22, 2024 20:43
@STREGA STREGA changed the title Require Swift 6 and tools v6 Swift 6, SwiftUnicodeDataTables, Other Improvements Nov 23, 2024
@STREGA STREGA marked this pull request as ready for review December 6, 2024 16:52
@STREGA
Copy link
Contributor Author

STREGA commented Dec 6, 2024

@finnvoor sorry for so many changes in 1 PR, mostly all related stuff. Confirmed to work on device.


func pdc(_ arguments: [String]) throws {
let process = Process()
process.executableURL = URL(filePath: "\(playdateSDK)/bin/pdc")
process.arguments = ["--skip-unknown"] + arguments
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason why this was removed? Without it the debug symbols are copied into the pix

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With that flag on, users can't have their own custom file types or any files the pdc doesn't compile. For example 3D models wouldn't be copied.

I'll add an extra step to delete the debug symbols from the finished pdx.

Copy link
Owner

@finnvoor finnvoor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks excellent, thanks for working on this. Seems like this also adds support for more than 1 level of dependencies which is great.

Ideally we'll be able to remove the unicode table target once the Swift team builds them without exceptions. Some people might also want a flag to opt out of linking them to reduce code size, but it seems like code size isn't a huge issue on Playdate.

@STREGA
Copy link
Contributor Author

STREGA commented Dec 10, 2024

Yup! Specifically I wanted to make sure PlaydateKit could be in a package (game engine) that users can import and use easily. It'll allow people to make and share "RPGKit" and stuff like that.

And yes I agree. This method could possibly cause problems if the toolchain changes anything. Definitely will be ideal to have the official static library available.

@STREGA
Copy link
Contributor Author

STREGA commented Dec 10, 2024

Added a step to remove the copied debug symbols.
Also cleaned up some unnecessary output stuff.

@finnvoor finnvoor merged commit cb1af58 into finnvoor:main Dec 10, 2024
1 check passed
@STREGA STREGA deleted the swift-6 branch December 10, 2024 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants