# We have a conf and classes directory, append to BBPATH
BBPATH .= ":${LAYERDIR}"

# We have recipes-* directories, add to BBFILES
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb ${LAYERDIR}/recipes-*/*/*.bbappend"
# Recipes which backport later versions of other layers are placed here.
# Only valid for Toradex distributions.
BACKPORT_BBFILES = "${LAYERDIR}/backports/recipes-*/*/*.bb ${LAYERDIR}/backports/recipes-*/*/*.bbappend"
BBFILES += "${@ d.getVar('BACKPORT_BBFILES') if 'tdx' in d.getVar('DISTROOVERRIDES').split(':') else ''}"

BBFILE_COLLECTIONS += "toradex-ti-layer"
BBFILE_PATTERN_toradex-ti-layer = "^${LAYERDIR}/"
BBFILE_PRIORITY_toradex-ti-layer = "22"

# Let us add layer-specific bbappends which are only applied when that
# layer is included in our configuration
BBFILES += "${@' '.join('${LAYERDIR}/%s/recipes*/*/*.bbappend' % layer \
               for layer in BBFILE_COLLECTIONS.split())}"
# Add layer-specific bb files too
BBFILES += "${@' '.join('${LAYERDIR}/%s/recipes*/*/*.bb' % layer \
               for layer in BBFILE_COLLECTIONS.split())}"

LAYERDEPENDS_toradex-ti-layer = " \
    core \
    meta-ti-bsp \
    toradex-bsp-common-layer \
"
LAYERSERIES_COMPAT_toradex-ti-layer = "kirkstone mickledore nanbield"
