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

Add ability to build swift code #4616

Open
theromis opened this issue Oct 14, 2024 · 5 comments
Open

Add ability to build swift code #4616

theromis opened this issue Oct 14, 2024 · 5 comments

Comments

@theromis
Copy link

theromis commented Oct 14, 2024

Describe the Feature
A clear and concise description of what the feature request is.
currently swift impossible to build, Godot uses scons for builds including MacOS/iOS, unfortunately Apple moves current features from Objective-C to SWIFT.

Required information

brew install scons
  • What Platform are you on? (Linux/Windows and which version)
    MacOS
  • How to reproduce your issue? Please include a small self contained reproducer. Likely a SConstruct should do for most issues.
    try to build swift code for godot engine
  • How you invoke scons (The command line you're using "scons --flags some_arguments")
scons platform=ios target=template_release

Additional context
After latest update SKStoreReviewController is removed from build (using it to rate app) so build is just fails, temporarily removed this call.
In last xcode it replaced by
AppStore.requestReview(in: scene)
but it exists only in SWIFT, so right now is just impossible to use this feature
https://forums.developer.apple.com/forums/thread/759918

@theromis theromis changed the title Add ability build swift code Add ability to build swift code Oct 14, 2024
@mwichmann
Copy link
Collaborator

Any ideas what would be required? Most of us here have zero knowledge of swift. If it needs to have its own tool, construction variables, etc. adding a working setup to https://github.com/SCons/scons-contrib is a good starting point. If that proves to be widely useful, it can be considered for inclusion in the SCons core.

P.S. it's useful if you read the instructions in the issue template :-)

@theromis
Copy link
Author

Thank you for quick reply, I can tell for iOS specific Swift/SwiftUI required tool is Xcode, probably mainstream Swift build should be https://www.swift.org/documentation/swift-compiler/ it won't work for MacOS/iOS specific stuff but will build some common code.

@mwichmann
Copy link
Collaborator

By "tool" I meant "SCons tool specification module".

For example, there is no separate (SCons) tool for Objective C/C++, just a recognition of standard file syntaxes for those types of files. If swift doesn't get magically handled by, say, clang, by it handing off control to the real compiler, then it probably needs a tool module. Those aren't hard to build, but takes some knowledge of both SCons and of the way to invoke the compiler.

@theromis
Copy link
Author

Thank you, will try to provide something

@theromis
Copy link
Author

PR created SCons/scons-contrib#53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants