Add ability to build swift code
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
- Link to SCons Users thread discussing your issue. https://github.com/godotengine/godot-proposals/issues/10967
- Version of SCons latest
- Version of Python latest
- Which python distribution if applicable (python.org, cygwin, anaconda, macports, brew,etc) MacOS distribution
- How you installed SCons
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
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 :-)
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.
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.
Thank you, will try to provide something
PR created https://github.com/SCons/scons-contrib/pull/53