[OE-core] [PATCH] cmake.bbclass: use `cmake --build` to build & install

Andre McCurdy armccurdy at gmail.com
Tue May 2 16:49:11 UTC 2017


On Tue, May 2, 2017 at 8:49 AM, Cody P Schafer <dev at codyps.com> wrote:
>>>  do_compile[progress] = "percent"
>>>  cmake_do_compile()  {
>>> -       cd ${B}
>>
>> Removing the redundant "cd ${B}" should perhaps be a separate commit?
>
> I'm not really seeing that as useful, change right now can be viewed
> as "moves the ${B} from being in `cd` to being part of the command
> line for `cmake --build`". Is fairly straight forward because cmake
> requires a path be specified (where `make` makes it optional).

If ${B} is the default directory for both these tasks then "cd ${B}"
is redundant and can be removed. If it is not the default directory,
then removing it will potentially break do_compile_append() and
do_install_append() functions which rely on running in ${B}. That
logic doesn't depend on whether or not "cmake --build" takes care of
changing directory on it's own, so if "cd ${B}" is redundant, then
removing it should be standalone commit.

>>
>>> -       base_do_compile VERBOSE=1
>>> +       VERBOSE=1 cmake --build '${B}'
>>
>> This looks like it will cause parallel make and EXTRA_OEMAKE options
>> to be ignored?
>
> That is a good point. I don't think EXTRA_OEMAKE should matter here
> too much as configuration for cmake-based builds all is read at
> configure time, but the ${PARALLEL_MAKE} flag is definitely an issue.
>
> Doing this could work:
>
>     VERBOSE=1 cmake --build '${B}' -- ${EXTRA_OEMAKE}
>
> (And similar for install)
>
> And for the case of `-jN` like flags, make & ninja happen to be
> compatible (they share a few other flags, like `-l` and `-n`.
>
> Another alternative is passing ${PARALLEL_MAKE} (and
> ${PARALLEL_MAKEINST}) instead of directly using ${EXTRA_OEMAKE}.
>
> Also: I took a look at what else `run_oemake` is doing, and it
> contains some output printing (`bbnote`s the make command & `die`s on
> make failure), which could be added directly around the `cmake
> --build` invocations instead.



More information about the Openembedded-core mailing list