Swift-X tool to cross compile Swift and Objective-C(++) code to Android

I have added a tools repo that currently contains one tool called Swift-X which is a cross compiler that can compile Swift and Objective-C(++) sources into Android format (Elf32) .o object files.

See https://github.com/swift-x/tools for documentation and installation instructions.

This tool will be central in building the open sourced Objective-C and Swift runtimes to link against.

One comment on “Swift-X tool to cross compile Swift and Objective-C(++) code to Android

  1. Also I should mention the tests. If you clone or fork this repo, the swift-x directory contains some tests.

    Once you have completed the setup instructions, you can cd into the tests directory and run the following.

    swift-x.py test1.m test2.swift

    This will produce to .o files for test1.o and test2.o. These can be disassembled using the Android NDK objdump tool.

    This tool is found at $(NDK)/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-objdump

    As this project progresses, we will be adding more and more tests, but please feel free to fork and add your own, and send pull requests.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>