aboutsummaryrefslogtreecommitdiff
path: root/run_project_tests.py
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2021-06-02 19:30:55 +0200
committerDaniel Mensinger <daniel@mensinger-ka.de>2021-06-25 19:34:48 +0200
commit3f889606c7debafacd3da9c9e74caa61b45a13ff (patch)
tree2bc4821baebd6e50bfd2999d034328d60c596ff2 /run_project_tests.py
parent0f237b8d1d84e4906c758bbef44d81e93207f8e4 (diff)
downloadmeson-3f889606c7debafacd3da9c9e74caa61b45a13ff.zip
meson-3f889606c7debafacd3da9c9e74caa61b45a13ff.tar.gz
meson-3f889606c7debafacd3da9c9e74caa61b45a13ff.tar.bz2
Split compiler detection from Environment
This moves all the compiler detection logic into the new compilers.detect module. This dramatically reduces the size and complexity of Environment.
Diffstat (limited to 'run_project_tests.py')
-rwxr-xr-xrun_project_tests.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/run_project_tests.py b/run_project_tests.py
index 3522009..c9b7a8f 100755
--- a/run_project_tests.py
+++ b/run_project_tests.py
@@ -42,6 +42,7 @@ from mesonbuild import compilers
from mesonbuild import mesonlib
from mesonbuild import mlog
from mesonbuild import mtest
+from mesonbuild.compilers import compiler_from_language, detect_objc_compiler, detect_objcpp_compiler
from mesonbuild.build import ConfigurationData
from mesonbuild.mesonlib import MachineChoice, Popen_safe, TemporaryDirectoryWinProof
from mesonbuild.mlog import blue, bold, cyan, green, red, yellow, normal_green
@@ -884,7 +885,7 @@ def have_objc_compiler(use_tmp: bool) -> bool:
with TemporaryDirectoryWinProof(prefix='b ', dir=None if use_tmp else '.') as build_dir:
env = environment.Environment(None, build_dir, get_fake_options('/'))
try:
- objc_comp = env.detect_objc_compiler(MachineChoice.HOST)
+ objc_comp = detect_objc_compiler(env, MachineChoice.HOST)
except mesonlib.MesonException:
return False
if not objc_comp:
@@ -900,7 +901,7 @@ def have_objcpp_compiler(use_tmp: bool) -> bool:
with TemporaryDirectoryWinProof(prefix='b ', dir=None if use_tmp else '.') as build_dir:
env = environment.Environment(None, build_dir, get_fake_options('/'))
try:
- objcpp_comp = env.detect_objcpp_compiler(MachineChoice.HOST)
+ objcpp_comp = detect_objcpp_compiler(env, MachineChoice.HOST)
except mesonlib.MesonException:
return False
if not objcpp_comp:
@@ -1392,7 +1393,7 @@ def detect_system_compiler(options: 'CompilerArgumentType') -> None:
for lang in sorted(compilers.all_languages):
try:
- comp = env.compiler_from_language(lang, MachineChoice.HOST)
+ comp = compiler_from_language(env, lang, MachineChoice.HOST)
# note compiler id for later use with test.json matrix
compiler_id_map[lang] = comp.get_id()
except mesonlib.MesonException:
@@ -1412,7 +1413,7 @@ def print_compilers(env: 'Environment', machine: MachineChoice) -> None:
print()
for lang in sorted(compilers.all_languages):
try:
- comp = env.compiler_from_language(lang, machine)
+ comp = compiler_from_language(env, lang, machine)
details = '{:<10} {} {}'.format('[' + comp.get_id() + ']', ' '.join(comp.get_exelist()), comp.get_version_string())
except mesonlib.MesonException:
details = '[not found]'