aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/libiio/files/0001-python-Do-not-verify-whether-libiio-is-installed-whe.patch
blob: 4d3dcd5cedd44d2078037e0f8f8ada4abe681f80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From 717b0f46b23ddc042da481d1d446bdd1c6c49142 Mon Sep 17 00:00:00 2001
From: Julien Malik <julien.malik@unseenlabs.fr>
Date: Mon, 27 Jul 2020 14:34:44 +0200
Subject: [PATCH] python: Do not verify whether libiio is installed when
 cross-compiling

This should fix #561

Signed-off-by: Julien Malik <julien.malik@paraiso.me>
---
 bindings/python/setup.py.cmakein | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/bindings/python/setup.py.cmakein b/bindings/python/setup.py.cmakein
index cd14e2e..96d58a8 100644
--- a/bindings/python/setup.py.cmakein
+++ b/bindings/python/setup.py.cmakein
@@ -54,6 +54,13 @@ class InstallWrapper(install):
         install.run(self)
 
     def _check_libiio_installed(self):
+        cross_compiling = ("${CMAKE_CROSSCOMPILING}" == "TRUE")
+        if cross_compiling:
+            # When cross-compiling, we generally cannot dlopen
+            # the libiio shared lib from the build platform.
+            # Simply skip this check in that case.
+            return
+
         from platform import system as _system
         from ctypes import CDLL as _cdll
         from ctypes.util import find_library
-- 
2.25.1