To bring up more or less the same question. Is there a solid way to cross-compile for Android with a Swift SDK without using SwiftPM? If not, is there any work towards it?
So far, I couldn't find a single way to make swiftc work with the Swift Android SDK, so I wonder if this is even possible. CMake is unavoidable for complex mixed-language libraries, so I need to resort to two build systems, which is a maintenance burden. I'd love to avoid SwiftPM, but I can't find a way that's not by rebuilding the entire Swift toolchain for Android.
Switching out the similar Android triple and target config, plus adding CMAKE_SYSTEM_VERSION and CMAKE_ANDROID_NDK as shown in my above link, will get you most of the way there, but the Swift compiler also needs to know the location of the Android NDK sysroot and the Swift resource directory in your Swift SDK for Android, which can be passed in using CMAKE_Swift_FLAGS.
You will probably also have to link that bundle's clang resource directory to your NDK clang resource directory, which is one of the steps the setup-android-sdk.sh script we provide does for you when used with SwiftPM:
I know it seems complicated, but that's why SwiftPM saves you so much trouble, particularly since CMake's Swift support is still evolving.
We had some trouble with SwiftPM also, as this is the first Swift SDK bundle not to ship with the C/C++ headers and libraries for the target platform included, ie you have to download the Android C/C++ NDK separately. There are some Swift configuration bugs with such an external C/C++ platform SDK that we avoid with that setup-android-sdk.sh script. I'm looking at fixing those now and hopefully we can remove that script in the coming months.