c++ - cmake based bitbake recipe : sysroot missing? -


i feel must doing fundamentally wrong. created recipe based on cmake project. compiling project using toolchain yocto created simple running cmake make fails compile using recipe:

summary = "opendnp3 de facto reference implementation of ieee-1815 (dnp3)" description = "opendnp3 portable, scalable, , rigorously tested implementation of dnp3 (www.dnp.org) protocol stack written in c++11. library designed high-performance applications many concurrent tcp sessions or huge device simulations. embeds 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 += "" 

problem think cxxflags used g++ don't appear consistent cxxflags defined toolchain's environment. --sysroot missing , g++ fails find standard c++ headers (ex: cstdint).

i partially fixed issue overriding do_configure cmake.bbclas removing -dcmake_toolchain_file=${workdir}/toolchain.cmake. matter of fact cxxflags defined toolchain.cmake as:

 -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 

so sysroot defined (twice actually) as:

/home/star/moxa-build/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/dnp3/2.2.0-r0/recipe-sysroot 

but doesn't end in makefile generated cmake guess in toolchain.cmake makes project's cmake configuration go south.

turns out cmake issue project itself. there merry mix-up between c , cxx flags in 1 of included .cmake configuration file. i'll submit pull request maintainer. cxxflags being handled differently between sdk (included directly in th cxx command) , bitbake explained why worked sdk (still not quite sure why worked without toolchain.cmake though).

thanks.

--sysroot missing cxxflags because yocto stuffs in cxx variable itself. note alongside sysroots directory yocto have environment-setup-xxx file should source. that's sysroot stuff comes from.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -