我觉得我一定在做一些根本性的错误。我创建了一个基于cmake项目的配方。编译使用创建工具链yocto项目是运行cmake的然后使一样简单,但它不能使用配方编译:基于cmake的bitbake配方:sysroot缺失?
SUMMARY = "Opendnp3 is the de facto reference implementation of IEEE-1815 (DNP3)"
DESCRIPTION = "Opendnp3 is a portable, scalable, and rigorously tested implementation of the DNP3 (www.dnp.org) protocol stack written in C++11. The library is designed for high-performance applications like many concurrent TCP sessions or huge device simulations. It also embeds very nicely on Linux."
HOMEPAGE = "https://www.automatak.com/opendnp3"
SECTION = "libs"
DEPENDS = "asio"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://NOTICE;md5=9788d3abe6c9401d72fdb3717de33e6a"
SRCREV = "e00ff31b837821064e5208c15866a9d46f8777b1"
SRC_URI = "git://github.com/automatak/dnp3;branch=2.0.x"
S = "${WORKDIR}/git"
inherit cmake
EXTRA_OECMAKE += ""
问题是我想的是,用于克CXXFLAGS ++不会出现以与由工具链环境定义的CXXFLAGS保持一致。主要是--sysroot丢失,g ++无法找到标准C++头文件(例如:cstdint)。
我部分地由从cmake.bbclas重写do_configure简单地通过除去-DCMAKE_TOOLCHAIN_FILE = $ {WORKDIR} /toolchain.cmake固定的问题。
-march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a8 --sysroot=/home/star/moxa-build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/dnp3/2.2.0-r0/recipe-sysroot -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/star/moxa-build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/dnp3/2.2.0-r0=/usr/src/debug/dnp3/2.2.0-r0 -fdebug-prefix-map=/home/star/moxa-build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/dnp3/2.2.0-r0/recipe-sysroot-native= -fdebug-prefix-map=/home/star/moxa-build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/dnp3/2.2.0-r0/recipe-sysroot= -fvisibility-inlines-hidden -march=armv7-a -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a8 --sysroot=/home/star/moxa-build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/dnp3/2.2.0-r0/recipe-sysroot
所以SYSROOT定义(两次实际上)为:事实上CXXFLAGS的问题是由toolchain.cmake定义
/home/star/moxa-build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/dnp3/2.2.0-r0/recipe-sysroot
但在Makefile中并没有结束上升cmake的产生所以我猜想toolchain.cmake中的某些东西会使项目的cmake配置向南。
原来这是项目本身的一个cmake问题。在其中一个包含的.cmake配置文件中,C和CXX标志之间出现了混淆。我会向维护者提交一个请求。 CXXFLAGS在SDK(直接包含在CXX命令中)和bitbake之间的处理方式不同,它解释了为什么它可以与SDK协同工作(尽管如此,仍然不太清楚它为什么在没有toolchain.cmake的情况下运行)。
谢谢。
你可以发布错误,当你bitbake食谱?您是否尝试过没有EXTRA_OECMAKE行? – Katu
当然。配方编译日志是[here](https://drive.google.com/open?id=0B_Ag-ilTJ9VVaFhyZTVLMGVIdHc)。删除该行时的结果相同_EXTRA_OECMAKE + =“”_ – Louis
我会检查错误“致命错误:cstdint:没有这样的文件或目录”。有些人建议您需要将gcc-multilib添加到图像中。 https://lists.yoctoproject.org/pipermail/yocto/2014-September/021760.html – Katu