mirror of
git://git.openembedded.org/meta-openembedded
synced 2026-10-01 03:37:55 +00:00
grpc: fix grpc_cpp_plugin interpfor nativesdk
When building grpc for nativesdk the project tries to execute the nativesdk grpc_cpp_plugin instead of the host one. Apply the patch fixing the cross-compilation for nativesdk build and modify its contents to reflect its new purpose. Also: add grpc-native to dependencies. Signed-off-by: Hiram Lew <lew@avast.com> Signed-off-by: Jan Kaisrlik <jan.kaisrlik@avast.com> Signed-off-by: Lukas Karas <karas@avast.com> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
parent
1b68e3eb58
commit
f72160a3dc
@ -1,24 +1,26 @@
|
|||||||
From cc6dbabea0e452ebc93682df860a79ed9a45722e Mon Sep 17 00:00:00 2001
|
From 6d606f1101c1a172fb6d738d6f1865aa61849e68 Mon Sep 17 00:00:00 2001
|
||||||
From: Alexey Firago <alexey_firago@mentor.com>
|
From: Alexey Firago <alexey_firago@mentor.com>
|
||||||
Date: Fri, 20 Oct 2017 00:04:19 +0300
|
Date: Fri, 20 Oct 2017 00:04:19 +0300
|
||||||
Subject: [PATCH] CMakeLists.txt: Fix grpc_cpp_plugin path during
|
Subject: [PATCH] CMakeLists.txt: Fix grpc_cpp_plugin path during
|
||||||
cross-compilation
|
cross-compiling or native build
|
||||||
|
|
||||||
Signed-off-by: Alexey Firago <alexey_firago@mentor.com>
|
Signed-off-by: Alexey Firago <alexey_firago@mentor.com>
|
||||||
|
Signed-off-by: Hiram Lew <lew@avast.com>
|
||||||
|
Signed-off-by: Jan Kaisrlik <jan.kaisrlik@avast.com>
|
||||||
---
|
---
|
||||||
CMakeLists.txt | 9 ++++++++-
|
CMakeLists.txt | 9 ++++++++-
|
||||||
templates/CMakeLists.txt.template | 9 ++++++++-
|
templates/CMakeLists.txt.template | 9 ++++++++-
|
||||||
2 files changed, 16 insertions(+), 2 deletions(-)
|
2 files changed, 16 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||||
index f9cd630..9663934 100644
|
index a59fd81..cd90424 100644
|
||||||
--- a/CMakeLists.txt
|
--- a/CMakeLists.txt
|
||||||
+++ b/CMakeLists.txt
|
+++ b/CMakeLists.txt
|
||||||
@@ -170,6 +170,13 @@ function(protobuf_generate_grpc_cpp)
|
@@ -160,6 +160,13 @@ function(protobuf_generate_grpc_cpp)
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
+ #if cross-compiling, find host plugin
|
+ #if cross-compiling or nativesdk, find host plugin
|
||||||
+ if(CMAKE_CROSSCOMPILING)
|
+ if(CMAKE_CROSSCOMPILING)
|
||||||
+ find_program(gRPC_CPP_PLUGIN grpc_cpp_plugin)
|
+ find_program(gRPC_CPP_PLUGIN grpc_cpp_plugin)
|
||||||
+ else()
|
+ else()
|
||||||
@ -28,7 +30,7 @@ index f9cd630..9663934 100644
|
|||||||
set(_protobuf_include_path -I . -I ${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR})
|
set(_protobuf_include_path -I . -I ${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR})
|
||||||
foreach(FIL ${ARGN})
|
foreach(FIL ${ARGN})
|
||||||
get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
|
get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
|
||||||
@@ -345,7 +352,7 @@ function(protobuf_generate_grpc_cpp)
|
@@ -177,7 +184,7 @@ function(protobuf_generate_grpc_cpp)
|
||||||
COMMAND ${_gRPC_PROTOBUF_PROTOC_EXECUTABLE}
|
COMMAND ${_gRPC_PROTOBUF_PROTOC_EXECUTABLE}
|
||||||
ARGS --grpc_out=generate_mock_code=true:${_gRPC_PROTO_GENS_DIR}
|
ARGS --grpc_out=generate_mock_code=true:${_gRPC_PROTO_GENS_DIR}
|
||||||
--cpp_out=${_gRPC_PROTO_GENS_DIR}
|
--cpp_out=${_gRPC_PROTO_GENS_DIR}
|
||||||
@ -38,14 +40,14 @@ index f9cd630..9663934 100644
|
|||||||
${REL_FIL}
|
${REL_FIL}
|
||||||
DEPENDS ${ABS_FIL} ${_gRPC_PROTOBUF_PROTOC} grpc_cpp_plugin
|
DEPENDS ${ABS_FIL} ${_gRPC_PROTOBUF_PROTOC} grpc_cpp_plugin
|
||||||
diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template
|
diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template
|
||||||
index 64daf04..a7e8629 100644
|
index de13d02..b22bd5c 100644
|
||||||
--- a/templates/CMakeLists.txt.template
|
--- a/templates/CMakeLists.txt.template
|
||||||
+++ b/templates/CMakeLists.txt.template
|
+++ b/templates/CMakeLists.txt.template
|
||||||
@@ -209,6 +209,13 @@
|
@@ -209,6 +209,13 @@
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
+ #if cross-compiling, find host plugin
|
+ #if cross-compiling or nativesdk, find host plugin
|
||||||
+ if(CMAKE_CROSSCOMPILING)
|
+ if(CMAKE_CROSSCOMPILING)
|
||||||
+ find_program(gRPC_CPP_PLUGIN grpc_cpp_plugin)
|
+ find_program(gRPC_CPP_PLUGIN grpc_cpp_plugin)
|
||||||
+ else()
|
+ else()
|
||||||
@ -55,7 +57,7 @@ index 64daf04..a7e8629 100644
|
|||||||
set(_protobuf_include_path -I . -I <%text>${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR}</%text>)
|
set(_protobuf_include_path -I . -I <%text>${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR}</%text>)
|
||||||
foreach(FIL <%text>${ARGN}</%text>)
|
foreach(FIL <%text>${ARGN}</%text>)
|
||||||
get_filename_component(ABS_FIL <%text>${FIL}</%text> ABSOLUTE)
|
get_filename_component(ABS_FIL <%text>${FIL}</%text> ABSOLUTE)
|
||||||
@@ -390,7 +397,7 @@
|
@@ -226,7 +233,7 @@
|
||||||
COMMAND <%text>${_gRPC_PROTOBUF_PROTOC_EXECUTABLE}</%text>
|
COMMAND <%text>${_gRPC_PROTOBUF_PROTOC_EXECUTABLE}</%text>
|
||||||
ARGS --grpc_out=<%text>generate_mock_code=true:${_gRPC_PROTO_GENS_DIR}</%text>
|
ARGS --grpc_out=<%text>generate_mock_code=true:${_gRPC_PROTO_GENS_DIR}</%text>
|
||||||
--cpp_out=<%text>${_gRPC_PROTO_GENS_DIR}</%text>
|
--cpp_out=<%text>${_gRPC_PROTO_GENS_DIR}</%text>
|
||||||
@ -64,5 +66,6 @@ index 64daf04..a7e8629 100644
|
|||||||
<%text>${_protobuf_include_path}</%text>
|
<%text>${_protobuf_include_path}</%text>
|
||||||
<%text>${REL_FIL}</%text>
|
<%text>${REL_FIL}</%text>
|
||||||
DEPENDS <%text>${ABS_FIL}</%text> <%text>${_gRPC_PROTOBUF_PROTOC}</%text> grpc_cpp_plugin
|
DEPENDS <%text>${ABS_FIL}</%text> <%text>${_gRPC_PROTOBUF_PROTOC}</%text> grpc_cpp_plugin
|
||||||
--
|
--
|
||||||
2.7.4
|
2.7.4
|
||||||
|
|
||||||
|
|||||||
@ -8,6 +8,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
|
|||||||
|
|
||||||
DEPENDS = "gflags c-ares protobuf protobuf-native protobuf-c protobuf-c-native openssl"
|
DEPENDS = "gflags c-ares protobuf protobuf-native protobuf-c protobuf-c-native openssl"
|
||||||
DEPENDS_append_class-target = " gtest grpc-native "
|
DEPENDS_append_class-target = " gtest grpc-native "
|
||||||
|
DEPENDS_append_class-nativesdk = " grpc-native "
|
||||||
|
|
||||||
S = "${WORKDIR}/git"
|
S = "${WORKDIR}/git"
|
||||||
SRCREV = "d8020cb6daa87f1a3bb3b0c299bc081c4a3de1e8"
|
SRCREV = "d8020cb6daa87f1a3bb3b0c299bc081c4a3de1e8"
|
||||||
@ -16,6 +17,7 @@ SRC_URI = "git://github.com/grpc/grpc.git;protocol=https;branch=${BRANCH} \
|
|||||||
file://0001-CMakeLists.txt-Fix-libraries-installation-for-Linux.patch \
|
file://0001-CMakeLists.txt-Fix-libraries-installation-for-Linux.patch \
|
||||||
"
|
"
|
||||||
SRC_URI_append_class-target = " file://0001-CMakeLists.txt-Fix-grpc_cpp_plugin-path-during-cross.patch"
|
SRC_URI_append_class-target = " file://0001-CMakeLists.txt-Fix-grpc_cpp_plugin-path-during-cross.patch"
|
||||||
|
SRC_URI_append_class-nativesdk = " file://0001-CMakeLists.txt-Fix-grpc_cpp_plugin-path-during-cross.patch"
|
||||||
|
|
||||||
# Fixes build with older compilers 4.8 especially on ubuntu 14.04
|
# Fixes build with older compilers 4.8 especially on ubuntu 14.04
|
||||||
CXXFLAGS_append_class-native = " -Wl,--no-as-needed"
|
CXXFLAGS_append_class-native = " -Wl,--no-as-needed"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user