blob: bf3a2b2090e55243508c4092170acdbf0a559c82 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001# Turns certain DISTRO_FEATURES into overrides with the same
2# name plus a df- prefix. Ensures that these special
3# distro features remain set also for native and nativesdk
4# recipes, so that these overrides can also be used there.
5#
6# This makes it simpler to write .bbappends that only change the
7# task signatures of the recipe if the change is really enabled,
8# for example with:
Patrick Williams213cb262021-08-07 19:21:33 -05009# do_install:append:df-my-feature () { ... }
Brad Bishopd7bf8c12018-02-25 22:55:05 -050010# where "my-feature" is a DISTRO_FEATURE.
11#
12# The class is meant to be used in a layer.conf or distro
13# .inc file with:
14# INHERIT += "distrooverrides"
15# DISTRO_FEATURES_OVERRIDES += "my-feature"
16#
17# Beware that this part of OVERRIDES changes during parsing, so usage
18# of these overrides should be limited to .bb and .bbappend files,
19# because then DISTRO_FEATURES is final.
20
21DISTRO_FEATURES_OVERRIDES ?= ""
22DISTRO_FEATURES_OVERRIDES[doc] = "A space-separated list of <feature> entries. \
23Each entry is added to OVERRIDES as df-<feature> if <feature> is in DISTRO_FEATURES."
24
Patrick Williams213cb262021-08-07 19:21:33 -050025DISTRO_FEATURES_FILTER_NATIVE:append = " ${DISTRO_FEATURES_OVERRIDES}"
26DISTRO_FEATURES_FILTER_NATIVESDK:append = " ${DISTRO_FEATURES_OVERRIDES}"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050027
28# If DISTRO_FEATURES_OVERRIDES or DISTRO_FEATURES show up in a task
29# signature because of this line, then the task dependency on
30# OVERRIDES itself should be fixed. Excluding these two variables
31# with DISTROOVERRIDES[vardepsexclude] would just work around the problem.
32DISTROOVERRIDES .= "${@ ''.join([':df-' + x for x in sorted(set(d.getVar('DISTRO_FEATURES_OVERRIDES').split()) & set((d.getVar('DISTRO_FEATURES') or '').split()))]) }"