How to use DEPENDS in bitbake

Oli Gray picture Oli Gray · Jan 18, 2017 · Viewed 14.8k times · Source

I have a bitbake build environment with multiple recipes, which are dependent in a chain.

At the moment I have to do: bitbake recipe1 && bitbake recipe2

I have added: DEPENDS = "recipe1" to the meta-recipe2/recipe2.bb

bitbake-layers show-cross-depends shows this dependency.

There fore I expect running bitbake recipe2 to build recipe1 first, however it does not.

What do I need to do to build the dependencies listend in the DEPENDS variable?

Answer

Anders picture Anders · Jan 19, 2017

Adding recipe1 to recipe2by

DEPENDS += "recipe1"

should work fine for you. The line above means that before the do_configure task of recipe2 can be run, the task do_populate_sysroot fro mrecipe1 will have completed. This should work for all version of bitbake and OpenEmbedded.

You can achieve something similar to DEPENDS += "recipe1" by

do_configure[depends] += "recipe1:do_populate_sysroot"

If necessary, you could manually set up your own custom depends like this.