All of lore.kernel.org
 help / color / mirror / Atom feed
* [oe][meta-oe][kirkstone][PATCH] flatbuffers: adapt for cross-compilation environments
@ 2023-04-07  4:38 Bhabu Bindu
  2023-04-07 11:45 ` akuster808
  0 siblings, 1 reply; 4+ messages in thread
From: Bhabu Bindu @ 2023-04-07  4:38 UTC (permalink / raw)
  To: openembedded-devel, bhabu.bindu; +Cc: Bhabu Bindu, Ivan Stepic

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>
---
 meta-oe/recipes-devtools/flatbuffers/flatbuffers_2.0.0.bb | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

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 bf74f1229..44478ea0b 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}
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [oe][meta-oe][kirkstone][PATCH] flatbuffers: adapt for cross-compilation environments
  2023-04-07  4:38 [oe][meta-oe][kirkstone][PATCH] flatbuffers: adapt for cross-compilation environments Bhabu Bindu
@ 2023-04-07 11:45 ` akuster808
  2023-04-13  7:02   ` BINDU
  0 siblings, 1 reply; 4+ messages in thread
From: akuster808 @ 2023-04-07 11:45 UTC (permalink / raw)
  To: BINDU, openembedded-devel, bhabu.bindu; +Cc: Ivan Stepic



On 4/7/23 12:38 AM, BINDU wrote:
> 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.

Does this need to be done in Master as well?

-armin
>
> Signed-off-by: Ivan Stepic <Ivan.Stepic@bmw.de>
> Signed-off-by: Bhabu Bindu <bindudaniel1996@gmail.com>
> ---
>   meta-oe/recipes-devtools/flatbuffers/flatbuffers_2.0.0.bb | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
>
> 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 bf74f1229..44478ea0b 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}
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#101976): https://lists.openembedded.org/g/openembedded-devel/message/101976
> Mute This Topic: https://lists.openembedded.org/mt/98119685/3616698
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [akuster808@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [oe][meta-oe][kirkstone][PATCH] flatbuffers: adapt for cross-compilation environments
  2023-04-07 11:45 ` akuster808
@ 2023-04-13  7:02   ` BINDU
  2023-04-13 12:21     ` akuster808
  0 siblings, 1 reply; 4+ messages in thread
From: BINDU @ 2023-04-13  7:02 UTC (permalink / raw)
  To: akuster808; +Cc: openembedded-devel, Bhabu Bindu, Ivan Stepic

[-- Attachment #1: Type: text/plain, Size: 3014 bytes --]

Hello @akuster808@gmail.com <akuster808@gmail.com> ,

This is fixed in a different way in master, so this doesn't need to be be
done for master.



On Fri, 7 Apr, 2023, 5:15 pm akuster808, <akuster808@gmail.com> wrote:

>
>
> On 4/7/23 12:38 AM, BINDU wrote:
> > 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.
>
> Does this need to be done in Master as well?
>
> -armin
> >
> > Signed-off-by: Ivan Stepic <Ivan.Stepic@bmw.de>
> > Signed-off-by: Bhabu Bindu <bindudaniel1996@gmail.com>
> > ---
> >   meta-oe/recipes-devtools/flatbuffers/flatbuffers_2.0.0.bb | 7 ++++++-
> >   1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > 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 bf74f1229..44478ea0b 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}
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#101976):
> https://lists.openembedded.org/g/openembedded-devel/message/101976
> > Mute This Topic: https://lists.openembedded.org/mt/98119685/3616698
> > Group Owner: openembedded-devel+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [
> akuster808@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
>
>

[-- Attachment #2: Type: text/html, Size: 5145 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [oe][meta-oe][kirkstone][PATCH] flatbuffers: adapt for cross-compilation environments
  2023-04-13  7:02   ` BINDU
@ 2023-04-13 12:21     ` akuster808
  0 siblings, 0 replies; 4+ messages in thread
From: akuster808 @ 2023-04-13 12:21 UTC (permalink / raw)
  To: BINDU; +Cc: openembedded-devel, Bhabu Bindu, Ivan Stepic



On 4/13/23 3:02 AM, BINDU wrote:
> Hello @akuster808@gmail.com <mailto:akuster808@gmail.com> ,
>
> This is fixed in a different way in master, so this doesn't need to be 
> be done for master.

thanks for checking.

- armin
>
>
>
> On Fri, 7 Apr, 2023, 5:15 pm akuster808, <akuster808@gmail.com> wrote:
>
>
>
>     On 4/7/23 12:38 AM, BINDU wrote:
>     > 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.
>
>     Does this need to be done in Master as well?
>
>     -armin
>     >
>     > Signed-off-by: Ivan Stepic <Ivan.Stepic@bmw.de>
>     > Signed-off-by: Bhabu Bindu <bindudaniel1996@gmail.com>
>     > ---
>     >   meta-oe/recipes-devtools/flatbuffers/flatbuffers_2.0.0.bb
>     <http://flatbuffers_2.0.0.bb> | 7 ++++++-
>     >   1 file changed, 6 insertions(+), 1 deletion(-)
>     >
>     > diff --git
>     a/meta-oe/recipes-devtools/flatbuffers/flatbuffers_2.0.0.bb
>     <http://flatbuffers_2.0.0.bb>
>     b/meta-oe/recipes-devtools/flatbuffers/flatbuffers_2.0.0.bb
>     <http://flatbuffers_2.0.0.bb>
>     > index bf74f1229..44478ea0b 100644
>     > --- a/meta-oe/recipes-devtools/flatbuffers/flatbuffers_2.0.0.bb
>     <http://flatbuffers_2.0.0.bb>
>     > +++ b/meta-oe/recipes-devtools/flatbuffers/flatbuffers_2.0.0.bb
>     <http://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}
>     >
>     > -=-=-=-=-=-=-=-=-=-=-=-
>     > Links: You receive all messages sent to this group.
>     > View/Reply Online (#101976):
>     https://lists.openembedded.org/g/openembedded-devel/message/101976
>     > Mute This Topic: https://lists.openembedded.org/mt/98119685/3616698
>     > Group Owner: openembedded-devel+owner@lists.openembedded.org
>     <mailto:openembedded-devel%2Bowner@lists.openembedded.org>
>     > Unsubscribe:
>     https://lists.openembedded.org/g/openembedded-devel/unsub
>     [akuster808@gmail.com]
>     > -=-=-=-=-=-=-=-=-=-=-=-
>     >
>



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-04-13 12:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-07  4:38 [oe][meta-oe][kirkstone][PATCH] flatbuffers: adapt for cross-compilation environments Bhabu Bindu
2023-04-07 11:45 ` akuster808
2023-04-13  7:02   ` BINDU
2023-04-13 12:21     ` akuster808

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.