blob: 8985022fad43a26e86f802dc8cc3ef682b5c1b53 [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001From a498b56ba96948015f0f2784b2ab8296946716ee Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 1 Feb 2018 23:28:17 -0800
4Subject: [PATCH 4/4] CMakeLists.txt: Find c-ares in target sysroot alone
5
6Current code lets it look into native sysroot as well
7which is then preferred during cross compile and it adds
8absolute path to libcares into linker flags
9on heterogenous architectures linker complains and build
10fails
11
12| /mnt/a/oe/build/tmp/work/cortexa7t2hf-neon-vfpv4-bec-linux-gnueabi/grpc/1.8.5-r0/recipe-sysroot-native/usr/lib/lib
13cares.so.2.2.0: file not recognized: File format not recognized
14| collect2: error: ld returned 1 exit status
15
16Upstream-Status: Pending
17
18Signed-off-by: Khem Raj <raj.khem@gmail.com>
19---
20 CMakeLists.txt | 6 ++----
21 1 file changed, 2 insertions(+), 4 deletions(-)
22
23diff --git a/CMakeLists.txt b/CMakeLists.txt
24index 1d7eef1..058423d 100644
25--- a/CMakeLists.txt
26+++ b/CMakeLists.txt
27@@ -153,10 +153,8 @@ if("${gRPC_CARES_PROVIDER}" STREQUAL "module")
28 set(gRPC_INSTALL FALSE)
29 endif()
30 elseif("${gRPC_CARES_PROVIDER}" STREQUAL "package")
31- find_package(c-ares REQUIRED CONFIG)
32- if(TARGET c-ares::cares)
33- set(_gRPC_CARES_LIBRARIES c-ares::cares)
34- endif()
35+ find_package(c-ares REQUIRED)
36+ set(_gRPC_CARES_LIBRARIES cares)
37 set(_gRPC_FIND_CARES "if(NOT c-ares_FOUND)\n find_package(c-ares CONFIG)\nendif()")
38 endif()
39
40--
412.16.1
42