Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 1 | From a498b56ba96948015f0f2784b2ab8296946716ee Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Thu, 1 Feb 2018 23:28:17 -0800 |
| 4 | Subject: [PATCH 4/4] CMakeLists.txt: Find c-ares in target sysroot alone |
| 5 | |
| 6 | Current code lets it look into native sysroot as well |
| 7 | which is then preferred during cross compile and it adds |
| 8 | absolute path to libcares into linker flags |
| 9 | on heterogenous architectures linker complains and build |
| 10 | fails |
| 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 |
| 13 | cares.so.2.2.0: file not recognized: File format not recognized |
| 14 | | collect2: error: ld returned 1 exit status |
| 15 | |
| 16 | Upstream-Status: Pending |
| 17 | |
| 18 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 19 | --- |
| 20 | CMakeLists.txt | 6 ++---- |
| 21 | 1 file changed, 2 insertions(+), 4 deletions(-) |
| 22 | |
| 23 | diff --git a/CMakeLists.txt b/CMakeLists.txt |
| 24 | index 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 | -- |
| 41 | 2.16.1 |
| 42 | |