diff options
author | Vyacheslav Yurkov <uvv.mail@gmail.com> | 2021-10-04 22:21:30 +0200 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2021-10-08 17:23:17 -0700 |
commit | 5578f481a3239b099494e5211fa6497899e9b4ff (patch) | |
tree | d6c4ed0d324706bb19ed7af0bebbfc9b905b81d0 | |
parent | 9476e659b772627a52adb3e52ea0c1dea7a69271 (diff) | |
download | meta-openembedded-contrib-5578f481a3239b099494e5211fa6497899e9b4ff.tar.gz |
grpc: fix cross-compilation of grpc applications
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>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit 17af9e0501dc3eeedeadf14e50d1fa252d8c2ec7)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r-- | meta-oe/recipes-devtools/grpc/grpc_1.38.1.bb | 7 |
1 files changed, 6 insertions, 1 deletions
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 b4f10662dc..e2b86dad13 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" |