diff options
| author | Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> | 2022-04-08 09:30:03 +0200 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2022-04-10 10:05:35 -0700 |
| commit | 1a91a9cb27847fa4f436bb5810f3ec309d2b86ae (patch) | |
| tree | 2ef18e66575bcdf847384984ff89a3b68a2fb1a9 | |
| parent | 8291505ccdca91ddbb616e930e7584f18c34ad87 (diff) | |
| download | meta-openembedded-1a91a9cb27847fa4f436bb5810f3ec309d2b86ae.tar.gz | |
grpc: add cmake support for target
The CMake gRPC config checks for binaries and fails if a binary (plugin)
is missing. Fix the problem in the code and add the CMake gRPC config
back to the target package.
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
| -rw-r--r-- | meta-oe/recipes-devtools/grpc/grpc/0001-cmake-add-separate-export-for-plugin-targets.patch | 93 | ||||
| -rw-r--r-- | meta-oe/recipes-devtools/grpc/grpc_1.45.1.bb | 3 |
2 files changed, 94 insertions, 2 deletions
diff --git a/meta-oe/recipes-devtools/grpc/grpc/0001-cmake-add-separate-export-for-plugin-targets.patch b/meta-oe/recipes-devtools/grpc/grpc/0001-cmake-add-separate-export-for-plugin-targets.patch new file mode 100644 index 0000000000..679bd38829 --- /dev/null +++ b/meta-oe/recipes-devtools/grpc/grpc/0001-cmake-add-separate-export-for-plugin-targets.patch | |||
| @@ -0,0 +1,93 @@ | |||
| 1 | From 3150cb043363e05588062dd392b940be25594713 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com> | ||
| 3 | Date: Tue, 18 Feb 2020 14:17:07 +0100 | ||
| 4 | Subject: [PATCH] cmake: add separate export for plugin targets | ||
| 5 | |||
| 6 | Upstream-Status: Submitted [https://github.com/grpc/grpc/pull/29328] | ||
| 7 | |||
| 8 | |||
| 9 | --- | ||
| 10 | CMakeLists.txt | 18 +++++++++++------- | ||
| 11 | 1 file changed, 11 insertions(+), 7 deletions(-) | ||
| 12 | |||
| 13 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| 14 | index efdaf8936d..6608b1b00c 100644 | ||
| 15 | --- a/CMakeLists.txt | ||
| 16 | +++ b/CMakeLists.txt | ||
| 17 | @@ -10935,7 +10935,7 @@ target_link_libraries(grpc_cpp_plugin | ||
| 18 | |||
| 19 | |||
| 20 | if(gRPC_INSTALL) | ||
| 21 | - install(TARGETS grpc_cpp_plugin EXPORT gRPCTargets | ||
| 22 | + install(TARGETS grpc_cpp_plugin EXPORT gRPCPluginTargets | ||
| 23 | RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR} | ||
| 24 | BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR} | ||
| 25 | LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR} | ||
| 26 | @@ -10975,7 +10975,7 @@ target_link_libraries(grpc_csharp_plugin | ||
| 27 | |||
| 28 | |||
| 29 | if(gRPC_INSTALL) | ||
| 30 | - install(TARGETS grpc_csharp_plugin EXPORT gRPCTargets | ||
| 31 | + install(TARGETS grpc_csharp_plugin EXPORT gRPCPluginTargets | ||
| 32 | RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR} | ||
| 33 | BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR} | ||
| 34 | LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR} | ||
| 35 | @@ -11015,7 +11015,7 @@ target_link_libraries(grpc_node_plugin | ||
| 36 | |||
| 37 | |||
| 38 | if(gRPC_INSTALL) | ||
| 39 | - install(TARGETS grpc_node_plugin EXPORT gRPCTargets | ||
| 40 | + install(TARGETS grpc_node_plugin EXPORT gRPCPluginTargets | ||
| 41 | RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR} | ||
| 42 | BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR} | ||
| 43 | LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR} | ||
| 44 | @@ -11055,7 +11055,7 @@ target_link_libraries(grpc_objective_c_plugin | ||
| 45 | |||
| 46 | |||
| 47 | if(gRPC_INSTALL) | ||
| 48 | - install(TARGETS grpc_objective_c_plugin EXPORT gRPCTargets | ||
| 49 | + install(TARGETS grpc_objective_c_plugin EXPORT gRPCPluginTargets | ||
| 50 | RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR} | ||
| 51 | BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR} | ||
| 52 | LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR} | ||
| 53 | @@ -11095,7 +11095,7 @@ target_link_libraries(grpc_php_plugin | ||
| 54 | |||
| 55 | |||
| 56 | if(gRPC_INSTALL) | ||
| 57 | - install(TARGETS grpc_php_plugin EXPORT gRPCTargets | ||
| 58 | + install(TARGETS grpc_php_plugin EXPORT gRPCPluginTargets | ||
| 59 | RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR} | ||
| 60 | BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR} | ||
| 61 | LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR} | ||
| 62 | @@ -11135,7 +11135,7 @@ target_link_libraries(grpc_python_plugin | ||
| 63 | |||
| 64 | |||
| 65 | if(gRPC_INSTALL) | ||
| 66 | - install(TARGETS grpc_python_plugin EXPORT gRPCTargets | ||
| 67 | + install(TARGETS grpc_python_plugin EXPORT gRPCPluginTargets | ||
| 68 | RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR} | ||
| 69 | BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR} | ||
| 70 | LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR} | ||
| 71 | @@ -11175,7 +11175,7 @@ target_link_libraries(grpc_ruby_plugin | ||
| 72 | |||
| 73 | |||
| 74 | if(gRPC_INSTALL) | ||
| 75 | - install(TARGETS grpc_ruby_plugin EXPORT gRPCTargets | ||
| 76 | + install(TARGETS grpc_ruby_plugin EXPORT gRPCPluginTargets | ||
| 77 | RUNTIME DESTINATION ${gRPC_INSTALL_BINDIR} | ||
| 78 | BUNDLE DESTINATION ${gRPC_INSTALL_BINDIR} | ||
| 79 | LIBRARY DESTINATION ${gRPC_INSTALL_LIBDIR} | ||
| 80 | @@ -17349,6 +17349,10 @@ if(gRPC_INSTALL) | ||
| 81 | DESTINATION ${gRPC_INSTALL_CMAKEDIR} | ||
| 82 | NAMESPACE gRPC:: | ||
| 83 | ) | ||
| 84 | + install(EXPORT gRPCPluginTargets | ||
| 85 | + DESTINATION ${gRPC_INSTALL_CMAKEDIR} | ||
| 86 | + NAMESPACE gRPC:: | ||
| 87 | + ) | ||
| 88 | endif() | ||
| 89 | |||
| 90 | include(CMakePackageConfigHelpers) | ||
| 91 | -- | ||
| 92 | 2.30.2 | ||
| 93 | |||
diff --git a/meta-oe/recipes-devtools/grpc/grpc_1.45.1.bb b/meta-oe/recipes-devtools/grpc/grpc_1.45.1.bb index 872bc6afcb..292ea7f9b0 100644 --- a/meta-oe/recipes-devtools/grpc/grpc_1.45.1.bb +++ b/meta-oe/recipes-devtools/grpc/grpc_1.45.1.bb | |||
| @@ -24,6 +24,7 @@ SRCREV_grpc = "1c159689ceda2c408f7f9d97d96a264c9521b806" | |||
| 24 | BRANCH = "v1.45.x" | 24 | BRANCH = "v1.45.x" |
| 25 | SRC_URI = "git://github.com/grpc/grpc.git;protocol=https;name=grpc;branch=${BRANCH} \ | 25 | SRC_URI = "git://github.com/grpc/grpc.git;protocol=https;name=grpc;branch=${BRANCH} \ |
| 26 | file://0001-Revert-Changed-GRPCPP_ABSEIL_SYNC-to-GPR_ABSEIL_SYNC.patch \ | 26 | file://0001-Revert-Changed-GRPCPP_ABSEIL_SYNC-to-GPR_ABSEIL_SYNC.patch \ |
| 27 | file://0001-cmake-add-separate-export-for-plugin-targets.patch \ | ||
| 27 | " | 28 | " |
| 28 | # Fixes build with older compilers 4.8 especially on ubuntu 14.04 | 29 | # Fixes build with older compilers 4.8 especially on ubuntu 14.04 |
| 29 | CXXFLAGS:append:class-native = " -Wl,--no-as-needed" | 30 | CXXFLAGS:append:class-native = " -Wl,--no-as-needed" |
| @@ -80,8 +81,6 @@ do_configure:prepend:toolchain-clang:x86() { | |||
| 80 | 81 | ||
| 81 | BBCLASSEXTEND = "native nativesdk" | 82 | BBCLASSEXTEND = "native nativesdk" |
| 82 | 83 | ||
| 83 | SYSROOT_DIRS_IGNORE:append:class-target = " ${baselib}/cmake/grpc" | ||
| 84 | |||
| 85 | FILES:${PN}-compiler += " \ | 84 | FILES:${PN}-compiler += " \ |
| 86 | ${bindir} \ | 85 | ${bindir} \ |
| 87 | ${libdir}/libgrpc_plugin_support${SOLIBS} \ | 86 | ${libdir}/libgrpc_plugin_support${SOLIBS} \ |
