diff options
| -rw-r--r-- | meta-oe/recipes-extended/etcd/etcd-cpp-apiv3/0001-cmake-fix-when-cross-compiling.patch | 68 | ||||
| -rw-r--r-- | meta-oe/recipes-extended/etcd/etcd-cpp-apiv3_0.15.4.bb (renamed from meta-oe/recipes-extended/etcd/etcd-cpp-apiv3_0.15.3.bb) | 3 |
2 files changed, 1 insertions, 70 deletions
diff --git a/meta-oe/recipes-extended/etcd/etcd-cpp-apiv3/0001-cmake-fix-when-cross-compiling.patch b/meta-oe/recipes-extended/etcd/etcd-cpp-apiv3/0001-cmake-fix-when-cross-compiling.patch deleted file mode 100644 index ce12d4270a..0000000000 --- a/meta-oe/recipes-extended/etcd/etcd-cpp-apiv3/0001-cmake-fix-when-cross-compiling.patch +++ /dev/null | |||
| @@ -1,68 +0,0 @@ | |||
| 1 | From cb79329010d73e36ce64830914005f1c17f8f53c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?Cl=C3=A9ment=20P=C3=A9ron?= <peron.clem@gmail.com> | ||
| 3 | Date: Sat, 23 Sep 2023 11:32:18 +0200 | ||
| 4 | Subject: [PATCH] cmake: fix when cross compiling | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | In order to generate protobuf files CMake need to use the protoc | ||
| 10 | and grpc-cpp-plugin compiled for the host architecture. | ||
| 11 | |||
| 12 | Unfortunately, the protoc and grpc-cpp-plugin in the gRPC CMake | ||
| 13 | configuration file are the one for the target architecture. | ||
| 14 | |||
| 15 | Fix this by properly finding the correct executable when | ||
| 16 | CMake is cross compiling. | ||
| 17 | |||
| 18 | Signed-off-by: Clément Péron <peron.clem@gmail.com> | ||
| 19 | --- | ||
| 20 | Upstream-Status: Pending | ||
| 21 | |||
| 22 | CMakeLists.txt | 28 ++++++++++++++++++++++++++-- | ||
| 23 | 1 file changed, 26 insertions(+), 2 deletions(-) | ||
| 24 | |||
| 25 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| 26 | index 5aa1310..80ebad2 100644 | ||
| 27 | --- a/CMakeLists.txt | ||
| 28 | +++ b/CMakeLists.txt | ||
| 29 | @@ -120,10 +120,34 @@ if(Protobuf_PROTOC_EXECUTABLE) | ||
| 30 | endif() | ||
| 31 | endif() | ||
| 32 | |||
| 33 | +# When cross compiling we look for the native protoc compiler | ||
| 34 | +# overwrite protobuf::protoc with the proper protoc | ||
| 35 | +if(CMAKE_CROSSCOMPILING) | ||
| 36 | + find_program(Protobuf_PROTOC_EXECUTABLE REQUIRED NAMES protoc) | ||
| 37 | + if(NOT TARGET protobuf::protoc) | ||
| 38 | + add_executable(protobuf::protoc IMPORTED) | ||
| 39 | + endif() | ||
| 40 | + set_target_properties(protobuf::protoc PROPERTIES | ||
| 41 | + IMPORTED_LOCATION "${Protobuf_PROTOC_EXECUTABLE}") | ||
| 42 | +endif() | ||
| 43 | + | ||
| 44 | find_package(gRPC QUIET) | ||
| 45 | -if(gRPC_FOUND AND TARGET gRPC::grpc AND TARGET gRPC::grpc_cpp_plugin) | ||
| 46 | +if(gRPC_FOUND AND TARGET gRPC::grpc) | ||
| 47 | + # When cross compiling we look for the native grpc_cpp_plugin | ||
| 48 | + if(CMAKE_CROSSCOMPILING) | ||
| 49 | + find_program(GRPC_CPP_PLUGIN REQUIRED NAMES grpc_cpp_plugin) | ||
| 50 | + if(NOT TARGET gRPC::grpc_cpp_plugin) | ||
| 51 | + add_executable(gRPC::grpc_cpp_plugin IMPORTED) | ||
| 52 | + endif() | ||
| 53 | + set_target_properties(gRPC::grpc_cpp_plugin PROPERTIES | ||
| 54 | + IMPORTED_LOCATION "${GRPC_CPP_PLUGIN}") | ||
| 55 | + elseif(TARGET gRPC::grpc_cpp_plugin) | ||
| 56 | + get_target_property(GRPC_CPP_PLUGIN gRPC::grpc_cpp_plugin LOCATION) | ||
| 57 | + else() | ||
| 58 | + message(FATAL_ERROR "Found gRPC but no gRPC CPP plugin defined") | ||
| 59 | + endif() | ||
| 60 | + | ||
| 61 | set(GRPC_LIBRARIES gRPC::gpr gRPC::grpc gRPC::grpc++) | ||
| 62 | - get_target_property(GRPC_CPP_PLUGIN gRPC::grpc_cpp_plugin LOCATION) | ||
| 63 | get_target_property(GRPC_INCLUDE_DIR gRPC::grpc INTERFACE_INCLUDE_DIRECTORIES) | ||
| 64 | else() | ||
| 65 | include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindGRPC.cmake) | ||
| 66 | -- | ||
| 67 | 2.39.3 (Apple Git-145) | ||
| 68 | |||
diff --git a/meta-oe/recipes-extended/etcd/etcd-cpp-apiv3_0.15.3.bb b/meta-oe/recipes-extended/etcd/etcd-cpp-apiv3_0.15.4.bb index 2e149577dc..88a8ba3469 100644 --- a/meta-oe/recipes-extended/etcd/etcd-cpp-apiv3_0.15.3.bb +++ b/meta-oe/recipes-extended/etcd/etcd-cpp-apiv3_0.15.4.bb | |||
| @@ -6,11 +6,10 @@ LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=eae7da6a2cd1788a5cf8a9f838cf6450" | |||
| 6 | 6 | ||
| 7 | SRC_URI = " \ | 7 | SRC_URI = " \ |
| 8 | git://github.com/etcd-cpp-apiv3/etcd-cpp-apiv3.git;branch=master;protocol=https \ | 8 | git://github.com/etcd-cpp-apiv3/etcd-cpp-apiv3.git;branch=master;protocol=https \ |
| 9 | file://0001-cmake-fix-when-cross-compiling.patch \ | ||
| 10 | file://0001-include-stdint.h-for-int64_t-types.patch \ | 9 | file://0001-include-stdint.h-for-int64_t-types.patch \ |
| 11 | " | 10 | " |
| 12 | 11 | ||
| 13 | SRCREV = "e31ac4d4caa55fa662e207150ba40f8151b7ad96" | 12 | SRCREV = "ba6216385fc332b23d95683966824c2b86c2474e" |
| 14 | 13 | ||
| 15 | inherit cmake | 14 | inherit cmake |
| 16 | 15 | ||
