如何使用 cmake 处理 Yocto 配方中的符号链接?

How to deal with symbolic links in Yocto recipe using cmake?

我正在尝试将 cmocka 放入嵌入式 Linux 目标板。
我使用 Yocto 创建了 rootfs,并为 cmocka-1.1.5 添加了自定义配方。 cmocka 共享库是使用我的自定义 bitbake 配方生成的,但是当我尝试使用 bitbake core-image-sato 构建完整图像时,它失败并出现以下错误:

ERROR: cmocka-1.1.5-1.0+AUTOINC+546bd50924-r0 do_package_qa: QA Issue: non -dev/-dbg/nativesdk- package contains symlink .so: cmocka-1.1.5 path '/work/aarch64-poky-linux/cmocka-1.1.5/1.0+AUTOINC+546bd50924-r0/packages-split/cmocka-1.1.5/usr/lib/libcmocka.so' [dev-so]
ERROR: cmocka-1.1.5-1.0+AUTOINC+546bd50924-r0 do_package_qa: QA run found fatal errors. Please consider fixing them.
ERROR: cmocka-1.1.5-1.0+AUTOINC+546bd50924-r0 do_package_qa: 
ERROR: cmocka-1.1.5-1.0+AUTOINC+546bd50924-r0 do_package_qa: Function failed: do_package_qa
ERROR: Logfile of failure stored in: /mnt/Drive_2/odroid-yocto/build/tmp/work/aarch64-poky-linux/cmocka-1.1.5/1.0+AUTOINC+546bd50924-r0/temp/log.do_package_qa.22650
ERROR: Task (/mnt/Drive_2/odroid-yocto/meta-xeb360/recipes-cmocka/cmocka-1.1.5/cmocka-1.1.5.bb:do_package_qa) failed with exit code '1'  

我的自定义 bitbake 配方 cmocka-1.1.5.bb 如下所示:

DESCRIPTION = "An elegant unit testing framework for C with support for mock objects"
SECTION = "Unit Testing"
LICENSE = "GPLv3"

PR = "r0"

LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"

SRCREV = "${AUTOREV}"
PVBASE := "${PV}"
PV = "${PVBASE}+${SRCPV}"

SRC_URI = "git://git.cryptomilk.org/projects/cmocka.git"

S = "${WORKDIR}/git"

inherit pkgconfig cmake

EXTRA_OECMAKE = ""

PACKAGES = "${PN} ${PN}-dev ${PN}-dbg ${PN}-staticdev"

RDEPENDS_${PN}-staticdev = ""
RDEPENDS_${PN}-dev = ""
RDEPENDS_${PN}-dbg = ""

do_configure() { 
 cd ${S}/../build/
 cmake -DCMAKE_INSTALL_PREFIX=${exec_prefix} ../git/
}

do_compile() {
    cd ${S}/../build/
    oe_runmake
}

INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_SYSROOT_STRIP = "1"
SOLIBS = ".so*"
SOLIBSDEV += ".so"
FILES_SOLIBSDEV = ""

FILES_${PN}-dev = "\
    ${libdir}/lib*${SOLIBS} \
    ${includedir} \
    ${libdir}/pkgconfig \
    ${libdir}/cmake \
    ${libdir}/cmake/cmocka \
    ${libdir}/cmake/cmocka/cmocka-config.cmake \
    ${libdir}/cmake/cmocka/cmocka-config-version.cmake \
"  

谁能告诉我我遗漏了什么或做错了什么?

这个食谱可以像下面这样简化一点。游戏中的一些结构是不需要的。

DESCRIPTION = "\
cmocka is an elegant unit testing framework for C with support for mock \
objects. It only requires the standard C library, works on a range of computing \
platforms (including embedded) and with different compilers."

LICENSE = "Apache-2.0"

LIC_FILES_CHKSUM = "file://COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"

SRC_URI = "git://git.cryptomilk.org/projects/cmocka.git"

SRCREV = "546bd50924245f4ca7292a3ef6a92504aa375455"

PV = "1.1.5+git${SRCPV}"

S = "${WORKDIR}/git"

inherit pkgconfig cmake