[oe] [OE-core] [RFC][PATCH] cmake: respect ${S} and ${B}

Richard Purdie richard.purdie at linuxfoundation.org
Thu Dec 5 10:10:02 UTC 2013


On Thu, 2013-12-05 at 00:38 +0000, Ross Burton wrote:
> Hi,
> 
> This is a Request For Comments because it changes behaviour of the cmake class
> and I'm not entirely knowledgeable in cmake.
> 
> For some reason, cmake.bbclass doesn't use ${S} and ${B}, but instead has it's
> own variables OECMAKE_SOURCEPATH ("." by default) and OECMAKE_BUILDPATH ("" by
> default).  Those defaults meant that the build happened in the source directory,
> which conveniently was ${S}.  Unless ${B} was also set, in which case it all
> broke.
> 
> I don't see a good reason for cmake.bbclass having it's own special versions of
> ${S} and ${B}, so this patch drops them and replicates some of the logic in
> autotools.bbclass: specifically the part where if ${S} and ${B} are different,
> delete ${B} before building.  This ensures that switching machine doesn't re-use
> the same build directory, which was the cause of me going back to look at this
> (libproxy trying to use the nuc sysroot when I'm building for qemux86-64).
> 
> Some open questions:
> 
> 1) As I understand it cmake has more reliable support for out-of-tree builds
> than autotools.  If this is the case should cmake.bbclass set B ?=
> "${WORKDIR}/build", or leave setting of B to separatebuilddir.inc?  Are there
> known recipes using cmake that fail with out-of-tree builds?

separatebuilddir.inc was really a stopgap solution to see how widespread
potential issues were. Ideally I'd like to get to the point where
recipes flag themselves are broken with out of tree builds rather than
having a list of ones which are compatible.

Doing this for OE-Core is straightforward now but what about meta-oe?

Would there be interest in trying to change that default or is it going
to be too painful?

This means I'm in favour of changing the cmake default if we can, it
looks like a simpler problem space than autotools.bbclass

Cheers,

Richard




More information about the Openembedded-devel mailing list