From c631cac04c59f6ce741ddcf32754fb260042ffec Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Thu, 16 Jun 2016 18:54:52 +0530 Subject: tests: Fix 103 manygen when both cl and gcc are available Meson uses the 'CC' environment variable, so manygen.py should too --- test cases/common/103 manygen/subdir/manygen.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/test cases/common/103 manygen/subdir/manygen.py b/test cases/common/103 manygen/subdir/manygen.py index 3c692ee..4411183 100755 --- a/test cases/common/103 manygen/subdir/manygen.py +++ b/test cases/common/103 manygen/subdir/manygen.py @@ -13,7 +13,15 @@ if not os.path.isdir(outdir): print('Outdir does not exist.') sys.exit(1) -if shutil.which('cl'): +# Emulate the environment.detect_c_compiler() logic +compiler = os.environ.get('CC', None) +if not compiler: + compiler = shutil.which('cl') or \ + shutil.which('gcc') or \ + shutil.which('clang') or \ + shutil.which('cc') + +if 'cl' in os.path.basename(compiler): libsuffix = '.lib' is_vs = True compiler = 'cl' @@ -22,11 +30,6 @@ else: libsuffix = '.a' is_vs = False linker = 'ar' - compiler = shutil.which('gcc') - if compiler is None: - compiler = shutil.which('clang') - if compiler is None: - compiler = shutil.which('cc') if compiler is None: print('No known compilers found.') sys.exit(1) -- cgit v1.1