diff options
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r-- | mesonbuild/backend/backends.py | 8 | ||||
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 17 | ||||
-rw-r--r-- | mesonbuild/backend/vs2010backend.py | 13 |
3 files changed, 21 insertions, 17 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 5939488..9749eb4 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -20,7 +20,8 @@ from .. import mlog from .. import compilers import json import subprocess -from ..mesonlib import MesonException, get_compiler_for_source, classify_unity_sources +from ..mesonlib import MesonException, get_meson_script +from ..mesonlib import get_compiler_for_source, classify_unity_sources from ..compilers import CompilerArgs class CleanTrees: @@ -33,7 +34,7 @@ class CleanTrees: self.trees = trees class InstallData: - def __init__(self, source_dir, build_dir, prefix, strip_bin): + def __init__(self, source_dir, build_dir, prefix, strip_bin, mesonintrospect): self.source_dir = source_dir self.build_dir = build_dir self.prefix = prefix @@ -46,6 +47,7 @@ class InstallData: self.po = [] self.install_scripts = [] self.install_subdirs = [] + self.mesonintrospect = mesonintrospect class ExecutableSerialisation: def __init__(self, name, fname, cmd_args, env, is_cross, exe_wrapper, @@ -673,7 +675,7 @@ class Backend: def run_postconf_scripts(self): env = {'MESON_SOURCE_ROOT': self.environment.get_source_dir(), 'MESON_BUILD_ROOT': self.environment.get_build_dir(), - } + 'MESONINTROSPECT': get_meson_script(self.environment, 'mesonintrospect')} child_env = os.environ.copy() child_env.update(env) diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 1acfe78..a26222f 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -20,7 +20,8 @@ from .. import mlog from .. import dependencies from .. import compilers from ..compilers import CompilerArgs -from ..mesonlib import File, MesonException, get_compiler_for_source, Popen_safe +from ..mesonlib import File, MesonException +from ..mesonlib import get_meson_script, get_compiler_for_source, Popen_safe from .backends import CleanTrees, InstallData from ..build import InvalidArguments import os, sys, pickle, re @@ -514,7 +515,7 @@ int dummy; self.processed_targets[target.name + target.type_suffix()] = True def generate_run_target(self, target, outfile): - runnerscript = [sys.executable, self.environment.get_build_command(), '--internal', 'commandrunner'] + cmd = [sys.executable, self.environment.get_build_command(), '--internal', 'commandrunner'] deps = self.unwrap_dep_list(target) arg_strings = [] for i in target.args: @@ -530,7 +531,10 @@ int dummy; else: raise AssertionError('Unreachable code in generate_run_target: ' + str(i)) elem = NinjaBuildElement(self.all_outputs, target.name, 'CUSTOM_COMMAND', []) - cmd = runnerscript + [self.environment.get_source_dir(), self.environment.get_build_dir(), target.subdir] + cmd += [self.environment.get_source_dir(), + self.environment.get_build_dir(), + target.subdir, + get_meson_script(self.environment, 'mesonintrospect')] texe = target.command try: texe = texe.held_object @@ -607,7 +611,8 @@ int dummy; d = InstallData(self.environment.get_source_dir(), self.environment.get_build_dir(), self.environment.get_prefix(), - strip_bin) + strip_bin, + get_meson_script(self.environment, 'mesonintrospect')) elem = NinjaBuildElement(self.all_outputs, 'install', 'CUSTOM_COMMAND', 'PHONY') elem.add_dep('all') elem.add_item('DESC', 'Installing files.') @@ -728,9 +733,7 @@ int dummy; def generate_tests(self, outfile): self.serialise_tests() - meson_exe = self.environment.get_build_command() - (base, ext) = os.path.splitext(meson_exe) - test_exe = base + 'test' + ext + test_exe = get_meson_script(self.environment, 'mesontest') cmd = [sys.executable, test_exe, '--no-rebuild'] if not self.environment.coredata.get_builtin_option('stdsplit'): cmd += ['--no-stdsplit'] diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index 82c6463..5ec49ad 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -24,7 +24,7 @@ from .. import mlog from .. import compilers from ..build import BuildTarget from ..compilers import CompilerArgs -from ..mesonlib import MesonException, File +from ..mesonlib import MesonException, File, get_meson_script from ..environment import Environment def split_o_flags_args(args): @@ -379,8 +379,10 @@ class Vs2010Backend(backends.Backend): customstep = ET.SubElement(action, 'PostBuildEvent') cmd_raw = [target.command] + target.args cmd = [sys.executable, os.path.join(self.environment.get_script_dir(), 'commandrunner.py'), - self.environment.get_build_dir(), self.environment.get_source_dir(), - self.get_target_dir(target)] + self.environment.get_build_dir(), + self.environment.get_source_dir(), + self.get_target_dir(target), + get_meson_script(self.environment, 'mesonintrospect')] for i in cmd_raw: if isinstance(i, build.BuildTarget): cmd.append(os.path.join(self.environment.get_build_dir(), self.get_target_filename(i))) @@ -1123,11 +1125,8 @@ if %%errorlevel%% neq 0 goto :VCEnd''' postbuild = ET.SubElement(action, 'PostBuildEvent') ET.SubElement(postbuild, 'Message') # FIXME: No benchmarks? - meson_py = self.environment.get_build_command() - (base, ext) = os.path.splitext(meson_py) - mesontest_py = base + 'test' + ext test_command = [sys.executable, - mesontest_py, + get_meson_script(self.environment, 'mesontest'), '--no-rebuild'] if not self.environment.coredata.get_builtin_option('stdsplit'): test_command += ['--no-stdsplit'] |