Andrew Geissler | 6972109 | 2021-07-23 12:57:00 -0400 | [diff] [blame] | 1 | From 717b0f46b23ddc042da481d1d446bdd1c6c49142 Mon Sep 17 00:00:00 2001 |
| 2 | From: Julien Malik <julien.malik@unseenlabs.fr> |
| 3 | Date: Mon, 27 Jul 2020 14:34:44 +0200 |
| 4 | Subject: [PATCH] python: Do not verify whether libiio is installed when |
| 5 | cross-compiling |
| 6 | |
| 7 | This should fix #561 |
| 8 | |
| 9 | Signed-off-by: Julien Malik <julien.malik@paraiso.me> |
| 10 | --- |
| 11 | bindings/python/setup.py.cmakein | 7 +++++++ |
| 12 | 1 file changed, 7 insertions(+) |
| 13 | |
| 14 | diff --git a/bindings/python/setup.py.cmakein b/bindings/python/setup.py.cmakein |
| 15 | index cd14e2e..96d58a8 100644 |
| 16 | --- a/bindings/python/setup.py.cmakein |
| 17 | +++ b/bindings/python/setup.py.cmakein |
| 18 | @@ -54,6 +54,13 @@ class InstallWrapper(install): |
| 19 | install.run(self) |
| 20 | |
| 21 | def _check_libiio_installed(self): |
| 22 | + cross_compiling = ("${CMAKE_CROSSCOMPILING}" == "TRUE") |
| 23 | + if cross_compiling: |
| 24 | + # When cross-compiling, we generally cannot dlopen |
| 25 | + # the libiio shared lib from the build platform. |
| 26 | + # Simply skip this check in that case. |
| 27 | + return |
| 28 | + |
| 29 | from platform import system as _system |
| 30 | from ctypes import CDLL as _cdll |
| 31 | from ctypes.util import find_library |
| 32 | -- |
| 33 | 2.25.1 |
| 34 | |