diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2018-10-04 20:52:08 -0400 |
---|---|---|
committer | John Ericson <git@JohnEricson.me> | 2019-06-09 13:13:25 -0400 |
commit | 07777e15d47dbddaf849d24b3a30c85745c533ca (patch) | |
tree | f472472ed511498c329b4e13e19b1585e1afb621 /run_project_tests.py | |
parent | 32e827dcdc451e1c5dde952cf08e4b654eac7057 (diff) | |
download | meson-07777e15d47dbddaf849d24b3a30c85745c533ca.zip meson-07777e15d47dbddaf849d24b3a30c85745c533ca.tar.gz meson-07777e15d47dbddaf849d24b3a30c85745c533ca.tar.bz2 |
Purge `is_cross` and friends without changing user interfaces
In most cases instead pass `for_machine`, the name of the relevant
machines (what compilers target, what targets run on, etc). This allows
us to use the cross code path in the native case, deduplicating the
code.
As one can see, environment got bigger as more information is kept
structured there, while ninjabackend got a smaller. Overall a few amount
of lines were added, but the hope is what's added is a lot simpler than
what's removed.
Diffstat (limited to 'run_project_tests.py')
-rwxr-xr-x | run_project_tests.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/run_project_tests.py b/run_project_tests.py index 0f3e913..bbeb6ca 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -31,7 +31,7 @@ from mesonbuild import compilers from mesonbuild import mesonlib from mesonbuild import mlog from mesonbuild import mtest -from mesonbuild.mesonlib import stringlistify, Popen_safe +from mesonbuild.mesonlib import MachineChoice, stringlistify, Popen_safe from mesonbuild.coredata import backendlist import argparse import xml.etree.ElementTree as ET @@ -465,12 +465,12 @@ def have_objc_compiler(): with AutoDeletedDir(tempfile.mkdtemp(prefix='b ', dir='.')) as build_dir: env = environment.Environment(None, build_dir, get_fake_options('/')) try: - objc_comp = env.detect_objc_compiler(False) + objc_comp = env.detect_objc_compiler(MachineChoice.HOST) except mesonlib.MesonException: return False if not objc_comp: return False - env.coredata.process_new_compilers('objc', objc_comp, None, env) + env.coredata.process_new_compiler('objc', objc_comp, env) try: objc_comp.sanity_check(env.get_scratch_dir(), env) except mesonlib.MesonException: @@ -481,12 +481,12 @@ def have_objcpp_compiler(): with AutoDeletedDir(tempfile.mkdtemp(prefix='b ', dir='.')) as build_dir: env = environment.Environment(None, build_dir, get_fake_options('/')) try: - objcpp_comp = env.detect_objcpp_compiler(False) + objcpp_comp = env.detect_objcpp_compiler(MachineChoice.HOST) except mesonlib.MesonException: return False if not objcpp_comp: return False - env.coredata.process_new_compilers('objcpp', objcpp_comp, None, env) + env.coredata.process_new_compiler('objcpp', objcpp_comp, env) try: objcpp_comp.sanity_check(env.get_scratch_dir(), env) except mesonlib.MesonException: @@ -793,7 +793,7 @@ def detect_system_compiler(): print() for lang in sorted(compilers.all_languages): try: - comp = env.compiler_from_language(lang, env.is_cross_build()) + comp = env.compiler_from_language(lang, MachineChoice.HOST) details = '%s %s' % (' '.join(comp.get_exelist()), comp.get_version_string()) except mesonlib.MesonException: comp = None |