From e755915872c57d5091b1dfc643f12ade8f567ba6 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 9 Apr 2018 11:53:45 +0200 Subject: Fail early in setup.py when clang can not be found Previously only a warning was printed when clang could not be found at setup.py time, resulting in a not very nice to parse CMake error. Make sure to fail early in setup.py if clang can not be found. Also make sure to check that the clang source variable0 is not "None", because passing "None" to run_process_output results in an even more obscure Python error. Change-Id: Ia94bf7da51996a3d9c74d5d9978b1bf9e26b03d5 Reviewed-by: Friedemann Kleint --- utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'utils.py') diff --git a/utils.py b/utils.py index c80e6dd6c..11d9fbc64 100644 --- a/utils.py +++ b/utils.py @@ -775,9 +775,10 @@ def detectClang(): if not clangDir: source = findLlvmConfig() try: - output = run_process_output([source, '--prefix']) - if output: - clangDir = output[0] + if source is not None: + output = run_process_output([source, '--prefix']) + if output: + clangDir = output[0] except OSError: pass if clangDir: -- cgit v1.2.3