Skip to content

Yocto recipe example

Joel Guittet edited this page Feb 24, 2023 · 5 revisions

Yocto recipe example

The following Yocto recipe cote_1.0.0.bb can be used to build and install cote on an embedded device. It depends of discover, axon and amp recipes. It also depends of cjson recipe.

DESCRIPTION = "Zero-configuration microservices library in C"
AUTHOR = "Joel Guittet"
HOMEPAGE = "https://github.com/joelguittet/c-cote"
SECTION = "libs"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=8177719bfce1d2623c11e0143d23a13e"

inherit cmake pkgconfig

PR = "r3"

S = "${WORKDIR}/git"

# Dependencies
DEPENDS_${PN} = "cjson discover axon amp"
RDEPENDS_${PN} += "cjson discover axon amp"
do_compile[depends] = "cjson:do_populate_sysroot discover:do_populate_sysroot axon:do_populate_sysroot amp:do_populate_sysroot"

# Flags
CFLAGS += " -I${STAGING_DIR_TARGET}/usr/include/cjson/"
CXXFLAGS += " -I${STAGING_DIR_TARGET}/usr/include/cjson/"

# Sources
SRC_URI = " \
    git://github.com/joelguittet/c-cote.git;tag=${PV}-${PR} \
"

BBCLASSEXTEND = "native nativesdk"
Clone this wiki locally