Adding a lib to yocto rootfs

905 views Asked by At

I am using this recipe, which by default doesn't copy the resulting .a lib (it expects header only usage I think)

I am trying to get the resultant libspdlog.a into my sysroot, but I can't seem to make that happen. I coppied the recipe to my layer (had to anyway because my project refereces an older version of meta-oe)

So far i've tried:

FILES_${PN} += "${libdir}/libspdlog.a"
FILES_${PN}-dev += "${libdir}/libspdlog.a"
FILES_${PN}-staticdev += "${libdir}/libspdlog.a" 

and

do_install() {
    install -d ${D}${libdir}
    install -m 0644 libspdlog.a ${D}${libdir}
 }

I'm pretty sure do_install is not getting called. I had to add to my IMAGE_INSTALL spd-dev so maybe this has something to do with it

Thanks

1

There are 1 answers

2
elcfd On

do_install is right and for now just have FILES_${PN} += "${libdir}/libspdlog.a".

If you have kept the same name of the recipe when you copied over you will need to add the following IMAGE_INSTALL_append = " spdlog" (in either local.conf or an image recipe if you have one) to put into image.

To verify do_install is working ok:

  • Inside your build folder (where you issue bitbake from) there will be tmp/work (if you haven't changed this in your local.conf)
  • Find the location of your recipe folder <recipe_name>/<recipe_version> (eg. spdlog/1.8.0-r0/)
  • Inside here there will be a packages-split/spdlog folder
  • Inside this you should see your structure usr/lib/libspdlog.a