aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2015-08-26 22:54:46 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2015-08-26 22:54:46 +0300
commitedf5c8898b8c5c7cb0e578e1cc84da0ea10768bd (patch)
tree50dfabe1bc39cfe15d18b7786a5fafd837ddbd85
parent6e6c7dd1fc0a352bd1fd54dc1526227f9c44ee96 (diff)
parent38b8178a14200c9ce7713706509908b0f7122aa2 (diff)
downloadmeson-edf5c8898b8c5c7cb0e578e1cc84da0ea10768bd.zip
meson-edf5c8898b8c5c7cb0e578e1cc84da0ea10768bd.tar.gz
meson-edf5c8898b8c5c7cb0e578e1cc84da0ea10768bd.tar.bz2
Merge pull request #245 from DragoonX6/master
Fix Python paths for MSYS2
-rw-r--r--ninjabackend.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/ninjabackend.py b/ninjabackend.py
index 9ed90f5..f38d1ca 100644
--- a/ninjabackend.py
+++ b/ninjabackend.py
@@ -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)