diff options
author | Jan Kaisrlik <jan.kaisrlik@avast.com> | 2018-10-10 15:54:57 +0200 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2018-10-10 08:53:21 -0700 |
commit | f72160a3dc1ee7e8c0edfb19cfdb4b6a7fa3ab2b (patch) | |
tree | 0de0c9e6800e50fdcd67f909ef047f6c9793d7ba /meta-networking/recipes-devtools | |
parent | 1b68e3eb582102ef2327fd90bfed6f32b54c2791 (diff) | |
download | meta-openembedded-f72160a3dc1ee7e8c0edfb19cfdb4b6a7fa3ab2b.tar.gz |
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>
Diffstat (limited to 'meta-networking/recipes-devtools')
-rw-r--r-- | meta-networking/recipes-devtools/grpc/grpc/0001-CMakeLists.txt-Fix-grpc_cpp_plugin-path-during-cross.patch | 27 | ||||
-rw-r--r-- | meta-networking/recipes-devtools/grpc/grpc_1.14.1.bb | 2 |
2 files changed, 17 insertions, 12 deletions
diff --git a/meta-networking/recipes-devtools/grpc/grpc/0001-CMakeLists.txt-Fix-grpc_cpp_plugin-path-during-cross.patch b/meta-networking/recipes-devtools/grpc/grpc/0001-CMakeLists.txt-Fix-grpc_cpp_plugin-path-during-cross.patch index a83d85407..54e0b99a4 100644 --- a/meta-networking/recipes-devtools/grpc/grpc/0001-CMakeLists.txt-Fix-grpc_cpp_plugin-path-during-cross.patch +++ b/meta-networking/recipes-devtools/grpc/grpc/0001-CMakeLists.txt-Fix-grpc_cpp_plugin-path-during-cross.patch | |||
@@ -1,24 +1,26 @@ | |||
1 | From cc6dbabea0e452ebc93682df860a79ed9a45722e Mon Sep 17 00:00:00 2001 | 1 | From 6d606f1101c1a172fb6d738d6f1865aa61849e68 Mon Sep 17 00:00:00 2001 |
2 | From: Alexey Firago <alexey_firago@mentor.com> | 2 | From: Alexey Firago <alexey_firago@mentor.com> |
3 | Date: Fri, 20 Oct 2017 00:04:19 +0300 | 3 | Date: Fri, 20 Oct 2017 00:04:19 +0300 |
4 | Subject: [PATCH] CMakeLists.txt: Fix grpc_cpp_plugin path during | 4 | Subject: [PATCH] CMakeLists.txt: Fix grpc_cpp_plugin path during |
5 | cross-compilation | 5 | cross-compiling or native build |
6 | 6 | ||
7 | Signed-off-by: Alexey Firago <alexey_firago@mentor.com> | 7 | Signed-off-by: Alexey Firago <alexey_firago@mentor.com> |
8 | Signed-off-by: Hiram Lew <lew@avast.com> | ||
9 | Signed-off-by: Jan Kaisrlik <jan.kaisrlik@avast.com> | ||
8 | --- | 10 | --- |
9 | CMakeLists.txt | 9 ++++++++- | 11 | CMakeLists.txt | 9 ++++++++- |
10 | templates/CMakeLists.txt.template | 9 ++++++++- | 12 | templates/CMakeLists.txt.template | 9 ++++++++- |
11 | 2 files changed, 16 insertions(+), 2 deletions(-) | 13 | 2 files changed, 16 insertions(+), 2 deletions(-) |
12 | 14 | ||
13 | diff --git a/CMakeLists.txt b/CMakeLists.txt | 15 | diff --git a/CMakeLists.txt b/CMakeLists.txt |
14 | index f9cd630..9663934 100644 | 16 | index a59fd81..cd90424 100644 |
15 | --- a/CMakeLists.txt | 17 | --- a/CMakeLists.txt |
16 | +++ b/CMakeLists.txt | 18 | +++ b/CMakeLists.txt |
17 | @@ -170,6 +170,13 @@ function(protobuf_generate_grpc_cpp) | 19 | @@ -160,6 +160,13 @@ function(protobuf_generate_grpc_cpp) |
18 | return() | 20 | return() |
19 | endif() | 21 | endif() |
20 | 22 | ||
21 | + #if cross-compiling, find host plugin | 23 | + #if cross-compiling or nativesdk, find host plugin |
22 | + if(CMAKE_CROSSCOMPILING) | 24 | + if(CMAKE_CROSSCOMPILING) |
23 | + find_program(gRPC_CPP_PLUGIN grpc_cpp_plugin) | 25 | + find_program(gRPC_CPP_PLUGIN grpc_cpp_plugin) |
24 | + else() | 26 | + else() |
@@ -28,7 +30,7 @@ index f9cd630..9663934 100644 | |||
28 | set(_protobuf_include_path -I . -I ${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR}) | 30 | set(_protobuf_include_path -I . -I ${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR}) |
29 | foreach(FIL ${ARGN}) | 31 | foreach(FIL ${ARGN}) |
30 | get_filename_component(ABS_FIL ${FIL} ABSOLUTE) | 32 | get_filename_component(ABS_FIL ${FIL} ABSOLUTE) |
31 | @@ -345,7 +352,7 @@ function(protobuf_generate_grpc_cpp) | 33 | @@ -177,7 +184,7 @@ function(protobuf_generate_grpc_cpp) |
32 | COMMAND ${_gRPC_PROTOBUF_PROTOC_EXECUTABLE} | 34 | COMMAND ${_gRPC_PROTOBUF_PROTOC_EXECUTABLE} |
33 | ARGS --grpc_out=generate_mock_code=true:${_gRPC_PROTO_GENS_DIR} | 35 | ARGS --grpc_out=generate_mock_code=true:${_gRPC_PROTO_GENS_DIR} |
34 | --cpp_out=${_gRPC_PROTO_GENS_DIR} | 36 | --cpp_out=${_gRPC_PROTO_GENS_DIR} |
@@ -38,14 +40,14 @@ index f9cd630..9663934 100644 | |||
38 | ${REL_FIL} | 40 | ${REL_FIL} |
39 | DEPENDS ${ABS_FIL} ${_gRPC_PROTOBUF_PROTOC} grpc_cpp_plugin | 41 | DEPENDS ${ABS_FIL} ${_gRPC_PROTOBUF_PROTOC} grpc_cpp_plugin |
40 | diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template | 42 | diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template |
41 | index 64daf04..a7e8629 100644 | 43 | index de13d02..b22bd5c 100644 |
42 | --- a/templates/CMakeLists.txt.template | 44 | --- a/templates/CMakeLists.txt.template |
43 | +++ b/templates/CMakeLists.txt.template | 45 | +++ b/templates/CMakeLists.txt.template |
44 | @@ -209,6 +209,13 @@ | 46 | @@ -209,6 +209,13 @@ |
45 | return() | 47 | return() |
46 | endif() | 48 | endif() |
47 | 49 | ||
48 | + #if cross-compiling, find host plugin | 50 | + #if cross-compiling or nativesdk, find host plugin |
49 | + if(CMAKE_CROSSCOMPILING) | 51 | + if(CMAKE_CROSSCOMPILING) |
50 | + find_program(gRPC_CPP_PLUGIN grpc_cpp_plugin) | 52 | + find_program(gRPC_CPP_PLUGIN grpc_cpp_plugin) |
51 | + else() | 53 | + else() |
@@ -55,7 +57,7 @@ index 64daf04..a7e8629 100644 | |||
55 | set(_protobuf_include_path -I . -I <%text>${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR}</%text>) | 57 | set(_protobuf_include_path -I . -I <%text>${_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR}</%text>) |
56 | foreach(FIL <%text>${ARGN}</%text>) | 58 | foreach(FIL <%text>${ARGN}</%text>) |
57 | get_filename_component(ABS_FIL <%text>${FIL}</%text> ABSOLUTE) | 59 | get_filename_component(ABS_FIL <%text>${FIL}</%text> ABSOLUTE) |
58 | @@ -390,7 +397,7 @@ | 60 | @@ -226,7 +233,7 @@ |
59 | COMMAND <%text>${_gRPC_PROTOBUF_PROTOC_EXECUTABLE}</%text> | 61 | COMMAND <%text>${_gRPC_PROTOBUF_PROTOC_EXECUTABLE}</%text> |
60 | ARGS --grpc_out=<%text>generate_mock_code=true:${_gRPC_PROTO_GENS_DIR}</%text> | 62 | ARGS --grpc_out=<%text>generate_mock_code=true:${_gRPC_PROTO_GENS_DIR}</%text> |
61 | --cpp_out=<%text>${_gRPC_PROTO_GENS_DIR}</%text> | 63 | --cpp_out=<%text>${_gRPC_PROTO_GENS_DIR}</%text> |
@@ -64,5 +66,6 @@ index 64daf04..a7e8629 100644 | |||
64 | <%text>${_protobuf_include_path}</%text> | 66 | <%text>${_protobuf_include_path}</%text> |
65 | <%text>${REL_FIL}</%text> | 67 | <%text>${REL_FIL}</%text> |
66 | DEPENDS <%text>${ABS_FIL}</%text> <%text>${_gRPC_PROTOBUF_PROTOC}</%text> grpc_cpp_plugin | 68 | DEPENDS <%text>${ABS_FIL}</%text> <%text>${_gRPC_PROTOBUF_PROTOC}</%text> grpc_cpp_plugin |
67 | -- | 69 | -- |
68 | 2.7.4 | 70 | 2.7.4 |
71 | |||
diff --git a/meta-networking/recipes-devtools/grpc/grpc_1.14.1.bb b/meta-networking/recipes-devtools/grpc/grpc_1.14.1.bb index 7b3f73657..d23671432 100644 --- a/meta-networking/recipes-devtools/grpc/grpc_1.14.1.bb +++ b/meta-networking/recipes-devtools/grpc/grpc_1.14.1.bb | |||
@@ -8,6 +8,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" | |||
8 | 8 | ||
9 | DEPENDS = "gflags c-ares protobuf protobuf-native protobuf-c protobuf-c-native openssl" | 9 | DEPENDS = "gflags c-ares protobuf protobuf-native protobuf-c protobuf-c-native openssl" |
10 | DEPENDS_append_class-target = " gtest grpc-native " | 10 | DEPENDS_append_class-target = " gtest grpc-native " |
11 | DEPENDS_append_class-nativesdk = " grpc-native " | ||
11 | 12 | ||
12 | S = "${WORKDIR}/git" | 13 | S = "${WORKDIR}/git" |
13 | SRCREV = "d8020cb6daa87f1a3bb3b0c299bc081c4a3de1e8" | 14 | SRCREV = "d8020cb6daa87f1a3bb3b0c299bc081c4a3de1e8" |
@@ -16,6 +17,7 @@ SRC_URI = "git://github.com/grpc/grpc.git;protocol=https;branch=${BRANCH} \ | |||
16 | file://0001-CMakeLists.txt-Fix-libraries-installation-for-Linux.patch \ | 17 | file://0001-CMakeLists.txt-Fix-libraries-installation-for-Linux.patch \ |
17 | " | 18 | " |
18 | SRC_URI_append_class-target = " file://0001-CMakeLists.txt-Fix-grpc_cpp_plugin-path-during-cross.patch" | 19 | SRC_URI_append_class-target = " file://0001-CMakeLists.txt-Fix-grpc_cpp_plugin-path-during-cross.patch" |
20 | SRC_URI_append_class-nativesdk = " file://0001-CMakeLists.txt-Fix-grpc_cpp_plugin-path-during-cross.patch" | ||
19 | 21 | ||
20 | # Fixes build with older compilers 4.8 especially on ubuntu 14.04 | 22 | # Fixes build with older compilers 4.8 especially on ubuntu 14.04 |
21 | CXXFLAGS_append_class-native = " -Wl,--no-as-needed" | 23 | CXXFLAGS_append_class-native = " -Wl,--no-as-needed" |