aboutsummaryrefslogtreecommitdiff
path: root/run_project_tests.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2019-06-10 01:49:16 +0300
committerGitHub <noreply@github.com>2019-06-10 01:49:16 +0300
commit06df6e463f3d7f62676f8f9ce0cf81fbb4058eaf (patch)
treed6e80b4aa73a30e31861d35aa00127fd625fcca8 /run_project_tests.py
parent6b4b601eafc5320e62060f39da5acad7c3007942 (diff)
parent6d6af46edcb765d7046533fdad4d03b0c0c9cd64 (diff)
downloadmeson-06df6e463f3d7f62676f8f9ce0cf81fbb4058eaf.zip
meson-06df6e463f3d7f62676f8f9ce0cf81fbb4058eaf.tar.gz
meson-06df6e463f3d7f62676f8f9ce0cf81fbb4058eaf.tar.bz2
Merge pull request #4010 from Ericson2314/purge-cross-conditional-preview
Purge much `is_cross` and `<things>_cross` without changing user interfaces---includes on #5263
Diffstat (limited to 'run_project_tests.py')
-rwxr-xr-xrun_project_tests.py36
1 files changed, 18 insertions, 18 deletions
diff --git a/run_project_tests.py b/run_project_tests.py
index f6d83b5..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
@@ -126,14 +126,14 @@ def platform_fix_name(fname, compiler, env):
canonical_compiler = compiler
if '?lib' in fname:
- if mesonlib.for_windows(env.is_cross_build(), env) and canonical_compiler == 'msvc':
+ if env.machines.host.is_windows() and canonical_compiler == 'msvc':
fname = re.sub(r'lib/\?lib(.*)\.', r'bin/\1.', fname)
fname = re.sub(r'/\?lib/', r'/bin/', fname)
- elif mesonlib.for_windows(env.is_cross_build(), env):
+ elif env.machines.host.is_windows():
fname = re.sub(r'lib/\?lib(.*)\.', r'bin/lib\1.', fname)
fname = re.sub(r'\?lib(.*)\.dll$', r'lib\1.dll', fname)
fname = re.sub(r'/\?lib/', r'/bin/', fname)
- elif mesonlib.for_cygwin(env.is_cross_build(), env):
+ elif env.machines.host.is_cygwin():
fname = re.sub(r'lib/\?lib(.*)\.so$', r'bin/cyg\1.dll', fname)
fname = re.sub(r'lib/\?lib(.*)\.', r'bin/cyg\1.', fname)
fname = re.sub(r'\?lib(.*)\.dll$', r'cyg\1.dll', fname)
@@ -143,7 +143,7 @@ def platform_fix_name(fname, compiler, env):
if fname.endswith('?exe'):
fname = fname[:-4]
- if mesonlib.for_windows(env.is_cross_build(), env) or mesonlib.for_cygwin(env.is_cross_build(), env):
+ if env.machines.host.is_windows() or env.machines.host.is_cygwin():
return fname + '.exe'
if fname.startswith('?msvc:'):
@@ -158,40 +158,40 @@ def platform_fix_name(fname, compiler, env):
if fname.startswith('?cygwin:'):
fname = fname[8:]
- if not mesonlib.for_cygwin(env.is_cross_build(), env):
+ if not env.machines.host.is_cygwin():
return None
if fname.startswith('?!cygwin:'):
fname = fname[9:]
- if mesonlib.for_cygwin(env.is_cross_build(), env):
+ if env.machines.host.is_cygwin():
return None
if fname.endswith('?so'):
- if mesonlib.for_windows(env.is_cross_build(), env) and canonical_compiler == 'msvc':
+ if env.machines.host.is_windows() and canonical_compiler == 'msvc':
fname = re.sub(r'lib/([^/]*)\?so$', r'bin/\1.dll', fname)
fname = re.sub(r'/(?:lib|)([^/]*?)\?so$', r'/\1.dll', fname)
return fname
- elif mesonlib.for_windows(env.is_cross_build(), env):
+ elif env.machines.host.is_windows():
fname = re.sub(r'lib/([^/]*)\?so$', r'bin/\1.dll', fname)
fname = re.sub(r'/([^/]*?)\?so$', r'/\1.dll', fname)
return fname
- elif mesonlib.for_cygwin(env.is_cross_build(), env):
+ elif env.machines.host.is_cygwin():
fname = re.sub(r'lib/([^/]*)\?so$', r'bin/\1.dll', fname)
fname = re.sub(r'/lib([^/]*?)\?so$', r'/cyg\1.dll', fname)
fname = re.sub(r'/([^/]*?)\?so$', r'/\1.dll', fname)
return fname
- elif mesonlib.for_darwin(env.is_cross_build(), env):
+ elif env.machines.host.is_darwin():
return fname[:-3] + '.dylib'
else:
return fname[:-3] + '.so'
if fname.endswith('?implib') or fname.endswith('?implibempty'):
- if mesonlib.for_windows(env.is_cross_build(), env) and canonical_compiler == 'msvc':
+ if env.machines.host.is_windows() and canonical_compiler == 'msvc':
# only MSVC doesn't generate empty implibs
if fname.endswith('?implibempty') and compiler == 'msvc':
return None
return re.sub(r'/(?:lib|)([^/]*?)\?implib(?:empty|)$', r'/\1.lib', fname)
- elif mesonlib.for_windows(env.is_cross_build(), env) or mesonlib.for_cygwin(env.is_cross_build(), env):
+ elif env.machines.host.is_windows() or env.machines.host.is_cygwin():
return re.sub(r'\?implib(?:empty|)$', r'.dll.a', fname)
else:
return None
@@ -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