jeyshree
jeyshree

Reputation: 59

difference between inherit Directive and INHERIT Configuration Directive in bitbake

I am new to bitbake and i am learing it.

Can you please help me understand the difference between inherit Directive and INHERIT Configuration Directive?

My understanding on inherit Directive:

inherit Directive is used to inherit a class from .bbclass file into another .bbclass file or .bb(recipe) file

I am not able to understand what is INHERIT Configuration Directive?i saw the syntax INHERIT += "abc".what is it trying to do?why do we have 2 different inherit directives?

Thanks in advance

Upvotes: 1

Views: 1110

Answers (1)

Talel BELHAJSALEM
Talel BELHAJSALEM

Reputation: 4344

The difference between inherit and INHERIT is simple and is well explained in the Yocto documentation here:

... using INHERIT to inherit a class effectively inherits the class globally

So, there are two differences between them:

  1. Inheritance scope:
  • inherit only inherits a class for a given recipe
  • INHERIT inherits the class globally for all recipes, so all recipes have access to the classes functions or tasks, meaning if you have main tasks in that class (do_install, do_compile, ...) it will affect all recipes.
  1. Execution:
  • inherit will execute any anonymous function in the class during parsing
  • INHERIT will ignore any anonymous function in the class during parsing (check link)

NOTE

You can develop your own class for example having your utility functions and use it globally by multiple recipes rather than inheriting the class for each class.

Upvotes: 3

Related Questions