[swift-dev] Cross-compile for Android armv7 from OSX

Geordie Jay geojay at gmail.com
Tue Jan 19 04:50:06 CST 2016


Ok I'm confused as to what you mean now. I can't imagine how it'd make
sense to run CMake multiple times to build from one host for its own
platform (save the recursive make approach, which in itself never crossed
our mind AFIK, but you mentioned this is a separate issue anyway).

The suggestion was to run CMake once per compilation target, being invoked
from build-script(-impl, for now). That would give us the benefit of
CMAKE_SYSTEM_NAME providing the target system (as opposed to the host, as
is now the case), with CMAKE_HOST_SYSTEM_NAME available when we need it.
This would lead to splitting out the CMake directives in a more natural
way. I also understand (maybe incorrectly) that this would keep in-code
definitions like #if __APPLE__ and objc interop "automatically" valid
without the need for hacks or further intervention from further CMake
patches.

Based on what you wrote I understood that the above setup may be
undesirable for OS X->iOS compilation. Now that I've slept on it I'm
actually not sure why. Referring to the article you sent, each target's DAG
should be atomic and independent of one another (this may well be the point
where I'm missing something). Also, the build output for each target is
kept independent, meaning it wouldn't need to be rescanned from foreign
targets' CMake / ninja runs.

I'm interested to hear your thoughts about this

Geordie
Dmitri Gribenko <gribozavr at gmail.com> schrieb am Di., 19. Jan. 2016 um
02:51:

> On Mon, Jan 18, 2016 at 5:46 PM, Geordie Jay <geojay at gmail.com> wrote:
> > Hi Dimitri, thanks for the enlightening read. I'll keep those ideas in
> mind.
> >
> > By "Linux native" do you mean compiling eg. Linux arm from Linux x86_64
> with
> > the current scheme, and only running multiple invocations when compiling
> for
> > mutually ABI-incompatible platforms (eg. osx->android)?
>
> I meant building for the platform itself.  Compiling Linux arm from
> Linux x86_64 would likely require the two-step approach.
>
> Dmitri
>
> --
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20160119/113cdb58/attachment.html>


More information about the swift-dev mailing list