meta-openembedded/meta-oe/recipes-devtools/capnproto
Gyorgy Sarvari e3c5b2dd0c
capnproto: only export binaries for native build
The base problem this is trying to solve: capnproto has two main
components: libraries that can be linked against, and binary files
that can generate c++ code from capnproto definitions. When cross-compiling
one needs to use the cross-compiled libraries, but with the native
definition-compilers.
When linking against capnproto from another recipe, cross-compilation
fails, because the cmake files generated by capnproto verify the
existence of binary files in $bindir. When using a cross-compiled
version of capnproto, these binary files do not exist in RECIPE_SYSROOT, so
the compilation fails.

The previous patch: the previous solution patched the CMakeLists.txt
file in a way that it didn't export nor install the generated binary files.
Accidentally this also happened with native build (and happened knowingly with
target builds).

The new patch: instead of not installing and not exporting the binaries,
just install them without exporting, when creating a target build.
During compilation check is CMAKE_CROSSCOMPILING is set (coming from
cmake.bbclass) - if it is set, only install the binaries, without
exporting. When it is not set, resort to the original behavior.

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2025-02-25 09:46:52 -08:00
..
capnproto capnproto: only export binaries for native build 2025-02-25 09:46:52 -08:00
capnproto_1.0.2.bb capnproto: only export binaries for native build 2025-02-25 09:46:52 -08:00