chelper: Report an error if the C host code does not compile

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2019-11-07 11:32:20 -05:00
parent 5500538fc5
commit f63f68bbbb
1 changed files with 5 additions and 1 deletions

View File

@ -162,7 +162,11 @@ def check_build_code(srcdir, target, sources, cmd, other_files=[]):
logging.info("Building C code module %s", target) logging.info("Building C code module %s", target)
srcfiles = [os.path.join(srcdir, fname) for fname in sources] srcfiles = [os.path.join(srcdir, fname) for fname in sources]
destlib = os.path.join(srcdir, target) 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_main = None
FFI_lib = None FFI_lib = None