|
|
|
@ -312,7 +312,7 @@ class NinjaBackend(backends.Backend): |
|
|
|
|
def generate_run_target(self, target, outfile): |
|
|
|
|
runnerscript = os.path.join(self.environment.get_script_dir(), 'commandrunner.py') |
|
|
|
|
elem = NinjaBuildElement(target.name, 'CUSTOM_COMMAND', []) |
|
|
|
|
cmd = [sys.executable, runnerscript, self.environment.get_source_dir(), self.environment.get_build_dir(), |
|
|
|
|
cmd = [self.detect_pythonbin(), runnerscript, self.environment.get_source_dir(), self.environment.get_build_dir(), |
|
|
|
|
target.subdir, target.command] + target.args |
|
|
|
|
elem.add_item('COMMAND', cmd) |
|
|
|
|
elem.add_item('description', 'Running external command %s.' % target.name) |
|
|
|
@ -499,7 +499,7 @@ class NinjaBackend(backends.Backend): |
|
|
|
|
script_root = self.environment.get_script_dir() |
|
|
|
|
test_script = os.path.join(script_root, 'meson_test.py') |
|
|
|
|
test_data = os.path.join(self.environment.get_scratch_dir(), 'meson_test_setup.dat') |
|
|
|
|
cmd = [sys.executable, test_script, test_data] |
|
|
|
|
cmd = [self.detect_pythonbin(), test_script, test_data] |
|
|
|
|
elem = NinjaBuildElement('test', 'CUSTOM_COMMAND', ['all', 'PHONY']) |
|
|
|
|
elem.add_item('COMMAND', cmd) |
|
|
|
|
elem.add_item('DESC', 'Running test suite.') |
|
|
|
@ -527,7 +527,7 @@ class NinjaBackend(backends.Backend): |
|
|
|
|
outfile.write(' description = $DESC\n') |
|
|
|
|
outfile.write(' restat = 1\n\n') |
|
|
|
|
outfile.write('rule REGENERATE_BUILD\n') |
|
|
|
|
c = (quote_char + ninja_quote(sys.executable) + quote_char, |
|
|
|
|
c = (quote_char + ninja_quote(self.detect_pythonbin()) + quote_char, |
|
|
|
|
quote_char + ninja_quote(self.environment.get_build_command()) + quote_char, |
|
|
|
|
quote_char + ninja_quote(self.environment.get_source_dir()) + quote_char, |
|
|
|
|
quote_char + ninja_quote(self.environment.get_build_dir()) + quote_char) |
|
|
|
@ -834,7 +834,7 @@ class NinjaBackend(backends.Backend): |
|
|
|
|
scriptdir = self.environment.get_script_dir() |
|
|
|
|
outfile.write('\n') |
|
|
|
|
symrule = 'rule SHSYM\n' |
|
|
|
|
symcmd = ' command = "%s" "%s" %s %s $CROSS\n' % (ninja_quote(sys.executable), |
|
|
|
|
symcmd = ' command = "%s" "%s" %s %s $CROSS\n' % (ninja_quote(self.detect_pythonbin()), |
|
|
|
|
ninja_quote(os.path.join(scriptdir, 'symbolextractor.py')), |
|
|
|
|
'$in', '$out') |
|
|
|
|
synstat = ' restat = 1\n' |
|
|
|
@ -885,7 +885,7 @@ class NinjaBackend(backends.Backend): |
|
|
|
|
rule = 'rule %s_COMPILER\n' % compiler.get_language() |
|
|
|
|
invoc = ' '.join([ninja_quote(i) for i in compiler.get_exelist()]) |
|
|
|
|
command = ' command = %s %s $out $cratetype %s $ARGS $in\n' % \ |
|
|
|
|
(ninja_quote(sys.executable), |
|
|
|
|
(ninja_quote(self.detect_pythonbin()), |
|
|
|
|
ninja_quote(os.path.join(os.path.split(__file__)[0], "rustrunner.py")), |
|
|
|
|
invoc) |
|
|
|
|
description = ' description = Compiling Rust source $in.\n' |
|
|
|
@ -1399,14 +1399,14 @@ rule FORTRAN_DEP_HACK |
|
|
|
|
gcno_elem = NinjaBuildElement('clean-gcno', 'CUSTOM_COMMAND', 'PHONY') |
|
|
|
|
script_root = self.environment.get_script_dir() |
|
|
|
|
clean_script = os.path.join(script_root, 'delwithsuffix.py') |
|
|
|
|
gcno_elem.add_item('COMMAND', [sys.executable, clean_script, '.', 'gcno']) |
|
|
|
|
gcno_elem.add_item('COMMAND', [self.detect_pythonbin(), clean_script, '.', 'gcno']) |
|
|
|
|
gcno_elem.add_item('description', 'Deleting gcno files') |
|
|
|
|
gcno_elem.write(outfile) |
|
|
|
|
|
|
|
|
|
gcda_elem = NinjaBuildElement('clean-gcda', 'CUSTOM_COMMAND', 'PHONY') |
|
|
|
|
script_root = self.environment.get_script_dir() |
|
|
|
|
clean_script = os.path.join(script_root, 'delwithsuffix.py') |
|
|
|
|
gcda_elem.add_item('COMMAND', [sys.executable, clean_script, '.', 'gcda']) |
|
|
|
|
gcda_elem.add_item('COMMAND', [self.detect_pythonbin(), clean_script, '.', 'gcda']) |
|
|
|
|
gcda_elem.add_item('description', 'Deleting gcda files') |
|
|
|
|
gcda_elem.write(outfile) |
|
|
|
|
|
|
|
|
|