aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBINDU <bindudaniel1996@gmail.com>2023-04-07 10:08:45 +0530
committerArmin Kuster <akuster808@gmail.com>2023-04-13 08:23:09 -0400
commitb97dbaac6629e22138f71ae19eb421d041447619 (patch)
tree656d8d6f66af67df85659027ea3c5b3f7a5a345a
parent571e36e20e9d1f27af0eb4545291beeb64f280e2 (diff)
downloadmeta-openembedded-contrib-b97dbaac6629e22138f71ae19eb421d041447619.tar.gz
flatbuffers: adapt for cross-compilation environments
Flatbuffers contains a library and a schema compiler. The package contains cmake files to discover the libraries and the compiler tool. Currently, all of these cmake files are installed into the target sysroot. However, the compiler utility isn't installed into the sysroot (as it is not runnable on the build machine). When an application that depends on flatbuffers gets built, it uses flatbuffers' exported cmake targets to configure the project. One of the exported targets is FlatcTarget.cmake which expects to see flatc binary in /usr/bin of the sysroot. Since binaries for target don't end up in target sysroot, cmake configuration fails. This patch addresses this problem of flatbuffers' build infrastructure in cross-compiling environments. By removing FlatcTarget.cmake for target builds from the sysroot we essentially skip this step of flatbuffers' configuration. Signed-off-by: Ivan Stepic <Ivan.Stepic@bmw.de> Signed-off-by: Bhabu Bindu <bindudaniel1996@gmail.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-oe/recipes-devtools/flatbuffers/flatbuffers_2.0.0.bb7
1 files changed, 6 insertions, 1 deletions
diff --git a/meta-oe/recipes-devtools/flatbuffers/flatbuffers_2.0.0.bb b/meta-oe/recipes-devtools/flatbuffers/flatbuffers_2.0.0.bb
index bf74f1229f..44478ea0b2 100644
--- a/meta-oe/recipes-devtools/flatbuffers/flatbuffers_2.0.0.bb
+++ b/meta-oe/recipes-devtools/flatbuffers/flatbuffers_2.0.0.bb
@@ -25,12 +25,17 @@ BUILD_CXXFLAGS += "-fPIC"
# BUILD_TYPE=Release is required, otherwise flatc is not installed
EXTRA_OECMAKE += "\
-DCMAKE_BUILD_TYPE=Release \
- -DFLATBUFFERS_BUILD_TESTS=OFF \
+ -DFLATBUFFERS_BUILD_TESTS=OFF \
-DFLATBUFFERS_BUILD_SHAREDLIB=ON \
"
inherit cmake
+rm_flatc_cmaketarget_for_target() {
+ rm -f "${SYSROOT_DESTDIR}/${libdir}/cmake/flatbuffers/FlatcTargets.cmake"
+}
+SYSROOT_PREPROCESS_FUNCS:class-target += "rm_flatc_cmaketarget_for_target"
+
do_install:append() {
install -d ${D}${PYTHON_SITEPACKAGES_DIR}
cp -rf ${S}/python/flatbuffers ${D}${PYTHON_SITEPACKAGES_DIR}