aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/chelper/__init__.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2019-11-07 11:32:20 -0500
committerKevin O'Connor <kevin@koconnor.net>2019-11-07 11:32:20 -0500
commitf63f68bbbbbd97e25534d23ede2ab55bc77e235f (patch)
tree830917d16464e5510061473c6f252dc3761ef72a /klippy/chelper/__init__.py
parent5500538fc58231f0d80beb8191f25bc70e1b96eb (diff)
downloadkutter-f63f68bbbbbd97e25534d23ede2ab55bc77e235f.tar.gz
kutter-f63f68bbbbbd97e25534d23ede2ab55bc77e235f.tar.xz
kutter-f63f68bbbbbd97e25534d23ede2ab55bc77e235f.zip
chelper: Report an error if the C host code does not compile
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/chelper/__init__.py')
-rw-r--r--klippy/chelper/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/klippy/chelper/__init__.py b/klippy/chelper/__init__.py
index 22649f72..ed759f69 100644
--- a/klippy/chelper/__init__.py
+++ b/klippy/chelper/__init__.py
@@ -162,7 +162,11 @@ def check_build_code(srcdir, target, sources, cmd, other_files=[]):
logging.info("Building C code module %s", target)
srcfiles = [os.path.join(srcdir, fname) for fname in sources]
destlib = os.path.join(srcdir, target)
- os.system(cmd % (destlib, ' '.join(srcfiles)))
+ res = os.system(cmd % (destlib, ' '.join(srcfiles)))
+ if res:
+ msg = "Unable to build C code module (error=%s)" % (res,)
+ logging.error(msg)
+ raise Exception(msg)
FFI_main = None
FFI_lib = None