|
|
@ -27,6 +27,7 @@ import tempfile |
|
|
|
from pathlib import Path, PurePath |
|
|
|
from pathlib import Path, PurePath |
|
|
|
from mesonbuild import build |
|
|
|
from mesonbuild import build |
|
|
|
from mesonbuild import environment |
|
|
|
from mesonbuild import environment |
|
|
|
|
|
|
|
from mesonbuild import compilers |
|
|
|
from mesonbuild import mesonlib |
|
|
|
from mesonbuild import mesonlib |
|
|
|
from mesonbuild import mlog |
|
|
|
from mesonbuild import mlog |
|
|
|
from mesonbuild import mtest |
|
|
|
from mesonbuild import mtest |
|
|
@ -768,11 +769,23 @@ def detect_system_compiler(): |
|
|
|
|
|
|
|
|
|
|
|
with AutoDeletedDir(tempfile.mkdtemp(prefix='b ', dir='.')) as build_dir: |
|
|
|
with AutoDeletedDir(tempfile.mkdtemp(prefix='b ', dir='.')) as build_dir: |
|
|
|
env = environment.Environment(None, build_dir, get_fake_options('/')) |
|
|
|
env = environment.Environment(None, build_dir, get_fake_options('/')) |
|
|
|
try: |
|
|
|
print() |
|
|
|
comp = env.detect_c_compiler(env.is_cross_build()) |
|
|
|
for lang in sorted(compilers.all_languages): |
|
|
|
except: |
|
|
|
try: |
|
|
|
raise RuntimeError("Could not find C compiler.") |
|
|
|
comp = env.compiler_from_language(lang, env.is_cross_build()) |
|
|
|
system_compiler = comp.get_id() |
|
|
|
details = '%s %s' % (' '.join(comp.get_exelist()), comp.get_version_string()) |
|
|
|
|
|
|
|
except: |
|
|
|
|
|
|
|
comp = None |
|
|
|
|
|
|
|
details = 'not found' |
|
|
|
|
|
|
|
print('%-7s: %s' % (lang, details)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# note C compiler for later use by platform_fix_name() |
|
|
|
|
|
|
|
if lang == 'c': |
|
|
|
|
|
|
|
if comp: |
|
|
|
|
|
|
|
system_compiler = comp.get_id() |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
raise RuntimeError("Could not find C compiler.") |
|
|
|
|
|
|
|
print() |
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
|
if __name__ == '__main__': |
|
|
|
parser = argparse.ArgumentParser(description="Run the test suite of Meson.") |
|
|
|
parser = argparse.ArgumentParser(description="Run the test suite of Meson.") |
|
|
|