mirror of
https://git.yoctoproject.org/poky
synced 2026-04-21 12:32:15 +02:00
classes-recipe: add cython class
Recipes that use Cython typically also do some bespoke fixup. Add a class to centralise the logic: - Set CYTHON_PREFIX_MAP to stop build paths appearing in generated objects - Strip "Cython Metadata" blocks from generated code that ends up in the -src package (From OE-Core rev: 9752da112b618362d2fe1b61c8939b8410e98553) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
b34a4b3b01
commit
64b6e85808
11
meta/classes-recipe/cython.bbclass
Normal file
11
meta/classes-recipe/cython.bbclass
Normal file
@@ -0,0 +1,11 @@
|
||||
DEPENDS:append = " python3-cython-native"
|
||||
|
||||
# Remap the build paths that appear in generated .c code
|
||||
export CYTHON_PREFIX_MAP = "${S}=${TARGET_DBGSRC_DIR} ${B}=${TARGET_DBGSRC_DIR}"
|
||||
|
||||
do_compile[postfuncs] = "strip_cython_metadata"
|
||||
strip_cython_metadata() {
|
||||
# Remove the Cython Metadata headers that we don't need after the build, and
|
||||
# may contain build paths.
|
||||
find ${S} -name "*.c" -print0 | xargs -0 sed -i -e "/BEGIN: Cython Metadata/,/END: Cython Metadata/d"
|
||||
}
|
||||
Reference in New Issue
Block a user