All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vyacheslav Yurkov <uvv.mail@gmail.com>
To: openembedded-devel@lists.openembedded.org
Subject: [meta-oe][PATCH 1/2] grpc: fix cross-compilation of grpc applications
Date: Mon,  4 Oct 2021 22:21:30 +0200	[thread overview]
Message-ID: <4069569d2f67d9f9f30fd80a8cad827386887c8b.1633378334.git.uvv.mail@gmail.com> (raw)
In-Reply-To: <cover.1633378334.git.uvv.mail@gmail.com>

When we build an application that uses grpc for the target, following
error occurs

CMake Error at <application work dir>/recipe-sysroot/usr/lib/cmake/grpc/gRPCTargets.cmake:179 (message):
|   The imported target "gRPC::grpc_cpp_plugin" references the file
|
|      "<application work dir>/recipe-sysroot/usr/bin/grpc_cpp_plugin"
|
|   but this file does not exist.  Possible reasons include:
|
|   * The file was deleted, renamed, or moved to another location.
|
|   * An install or uninstall procedure did not complete successfully.
|
|   * The installation package was faulty and contained
|
|      "<application work dir>/recipe-sysroot/usr/lib/cmake/grpc/gRPCTargets.cmake"
|
|   but not all the files it references.
|
| Call Stack (most recent call first):
|   <application work dir>/recipe-sysroot/usr/lib/cmake/grpc/gRPCConfig.cmake:25 (include)
|   	CMakeLists.txt:4 (find_package)

That's because target grpc was built with CPP plugin support and
referenes it from CMake config file. This commit disables CPP plugin
build for the target, and sets dependency on compiler for native and SDK
builds

Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
---
 meta-oe/recipes-devtools/grpc/grpc_1.38.1.bb | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/meta-oe/recipes-devtools/grpc/grpc_1.38.1.bb b/meta-oe/recipes-devtools/grpc/grpc_1.38.1.bb
index b4f10662d..e2b86dad1 100644
--- a/meta-oe/recipes-devtools/grpc/grpc_1.38.1.bb
+++ b/meta-oe/recipes-devtools/grpc/grpc_1.38.1.bb
@@ -13,7 +13,11 @@ DEPENDS:append:class-nativesdk = " grpc-native "
 PACKAGE_BEFORE_PN = "${PN}-compiler"
 
 RDEPENDS:${PN}-compiler = "${PN}"
-RDEPENDS:${PN}-dev += "${PN}-compiler"
+RDEPENDS:${PN}-dev:class_native += "${PN}-compiler"
+# Configuration above allows to cross-compile gRPC applications
+# In order to compile applications on the target, use the dependency below
+# Both dependencies are mutually exclusive
+# RDEPENDS:${PN}-dev += "${PN}-compiler"
 
 S = "${WORKDIR}/git"
 SRCREV_grpc = "96b73272eadc01afb5fb45b92b408c47e4387274"
@@ -39,6 +43,7 @@ EXTRA_OECMAKE = " \
     "
 
 PACKAGECONFIG ??= "cpp shared"
+PACKAGECONFIG_class-target ?= "shared"
 PACKAGECONFIG[cpp] = "-DgRPC_BUILD_GRPC_CPP_PLUGIN=ON,-DgRPC_BUILD_GRPC_CPP_PLUGIN=OFF"
 PACKAGECONFIG[csharp] = "-DgRPC_BUILD_GRPC_CSHARP_PLUGIN=ON,-DgRPC_BUILD_GRPC_CSHARP_PLUGIN=OFF"
 PACKAGECONFIG[node] = "-DgRPC_BUILD_GRPC_NODE_PLUGIN=ON,-DgRPC_BUILD_GRPC_NODE_PLUGIN=OFF"
-- 
2.28.0



  reply	other threads:[~2021-10-04 20:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-04 20:21 [meta-oe][PATCH 0/2] gRPC Pull Request Vyacheslav Yurkov
2021-10-04 20:21 ` Vyacheslav Yurkov [this message]
2021-10-04 20:21 ` [meta-oe][PATCH 2/2] grpc: fix cross-compilation of grpc applications Vyacheslav Yurkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4069569d2f67d9f9f30fd80a8cad827386887c8b.1633378334.git.uvv.mail@gmail.com \
    --to=uvv.mail@gmail.com \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.