cmake rework (not again, still)

Dirk Hohndel dirk at hohndel.org
Mon Nov 23 07:26:45 PST 2015


On Mon, Nov 23, 2015 at 01:07:59PM -0200, Tomaz Canabrava wrote:
> So, a bit of history
> 
> Dirk asked me to make subsurface compile in iOS and adding another target
> to our cmake would be quite a task in the state that it currently was:
> 
> we could:
>  - use the desktop version on mobile
> - use the mobile on desktop
> - use cmake to find some libraries
> - use pkg-config to find the same libraries
> - a *lot* of boilerplate code on cmake
> - build subsurface in source, outsorce
> 
> I oversimplified some things and not everybody will be happy, so this is a
> call for a little chat, nothing that I did is fixed in stone and I can
> revert lots
> 
> now, in my desktop I  have around 25 patches that rework the cmake in the
> following way:
> 
> - desktop version only on desktop

Anton will be unhappy, but I'll let him comment on that

> - mobile version only on android (iOS to come)

That's not going to work. The turn-around time for development of the
mobile app if you have to deploy on a mobile OS (even if it's an
emulation) is at least an order of magnitude longer than just doing a
build on Linux (or MacOS) and running Subsurface-mobile there. While for
many things you have to build and test for/on iOS and Android, for a lot
of other code that is not necessary at all. In fact, I tend to do all the
work I do on Subsurface-mobile on Linux and only once it works there to my
satisfaction do I try an Android build and test on a device.

So no, Subsurface-mobile needs to be able to be compiled at least on
Linux, and likely on MacOS as well.

> - need to pass -DSUBSURFACE_TARGET_PLATFORM on compile time, if not passed
> it defaults to "Desktop"

So we already have SUBSURFACE_MOBILE which is set to indicate that you are
building Subsurface-mobile, if it isn't set, you're building the dekstop
version. Can you explain what this new define does that we don't have
already?

And the naming is terrible - TARGET_PLATFORM should be the name of an OS,
of a platform, not a concept like "Deksop" vs. "Mobile".

> - out-of-source-build only

That I'm OK with. build.sh has done this for a long time and I believe at
this point most people at least start by using build.sh


/D


More information about the subsurface mailing list