diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-11-04 19:56:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-04 19:56:08 +0200 |
commit | 1eb455f8696643b625b10a85551ff9fd28dd7d2a (patch) | |
tree | f6fa0bb549b609d3db1fea05181e7ff92c6b1fa3 /run_project_tests.py | |
parent | 253c581412d7f2b09af353dd83d943454bd555be (diff) | |
parent | ac6d4338cce68f5040825fb9bfb95dd147390e76 (diff) | |
download | meson-1eb455f8696643b625b10a85551ff9fd28dd7d2a.zip meson-1eb455f8696643b625b10a85551ff9fd28dd7d2a.tar.gz meson-1eb455f8696643b625b10a85551ff9fd28dd7d2a.tar.bz2 |
Merge pull request #4250 from jon-turney/windows-clang-cl
Add support for clang-cl on Windows
Diffstat (limited to 'run_project_tests.py')
-rwxr-xr-x | run_project_tests.py | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/run_project_tests.py b/run_project_tests.py index 2445dd4..c73567e 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -132,17 +132,17 @@ def platform_fix_name(fname, compiler, env): if fname.startswith('?msvc:'): fname = fname[6:] - if compiler != 'cl': + if compiler != 'msvc': return None if fname.startswith('?gcc:'): fname = fname[5:] - if compiler == 'cl': + if compiler == 'msvc': return None if fname.startswith('?cygwin:'): fname = fname[8:] - if compiler == 'cl' or not mesonlib.for_cygwin(env.is_cross_build(), env): + if compiler == 'msvc' or not mesonlib.for_cygwin(env.is_cross_build(), env): return None return fname @@ -687,14 +687,18 @@ def check_meson_commands_work(): def detect_system_compiler(): global system_compiler - if shutil.which('cl'): - system_compiler = 'cl' - elif shutil.which('cc'): - system_compiler = 'cc' - elif shutil.which('gcc'): - system_compiler = 'gcc' - else: - raise RuntimeError("Could not find C compiler.") + + with AutoDeletedDir(tempfile.mkdtemp(prefix='b ', dir='.')) as build_dir: + env = environment.Environment(None, build_dir, get_fake_options('/')) + try: + comp = env.detect_c_compiler(env.is_cross_build()) + except: + raise RuntimeError("Could not find C compiler.") + system_compiler = comp.get_id() + + # canonicalize for platform_fix_name() + if system_compiler == 'clang-cl': + system_compiler = 'msvc' if __name__ == '__main__': parser = argparse.ArgumentParser(description="Run the test suite of Meson.") |