aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2013-02-16 21:49:00 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2013-02-16 21:49:00 +0200
commit8c6c0d9b82f46e808eeff658e73ee241ea58f2a0 (patch)
treeb109f2cd841f03008bf84448a8db81e465c0ac19
parentd5f7207e2ea2bbeebfdbb08fdfa478ad7ab713db (diff)
downloadmeson-8c6c0d9b82f46e808eeff658e73ee241ea58f2a0.zip
meson-8c6c0d9b82f46e808eeff658e73ee241ea58f2a0.tar.gz
meson-8c6c0d9b82f46e808eeff658e73ee241ea58f2a0.tar.bz2
Fix regeneration rule so it is not triggered needlessly.
-rwxr-xr-xgenerators.py8
-rwxr-xr-xrun_tests.py10
2 files changed, 11 insertions, 7 deletions
diff --git a/generators.py b/generators.py
index 2da5d68..bf44bd7 100755
--- a/generators.py
+++ b/generators.py
@@ -267,7 +267,9 @@ class NinjaGenerator(Generator):
c = (ninja_quote(self.environment.get_builder_command()),
ninja_quote(self.environment.get_source_dir()),
ninja_quote(self.environment.get_build_dir()))
- outfile.write(" command = '%s' '%s' '%s' -G ninja\n\n" % c)
+ outfile.write(" command = '%s' '%s' '%s' -G ninja\n" % c)
+ outfile.write(' description = Regenerating build files\n')
+ outfile.write(' generator = 1\n\n')
def generate_static_link_rules(self, outfile):
static_linker = self.build.static_linker
@@ -419,12 +421,14 @@ class NinjaGenerator(Generator):
default = 'default all\n\n'
outfile.write(build)
outfile.write(default)
+
deps = [ ninja_quote(os.path.join(self.build_to_src, df)) \
for df in self.interpreter.get_build_def_files()]
depstr = ' '.join(deps)
buildregen = 'build build.ninja: REGENERATE_BUILD | %s\n\n' % depstr
- ignore_missing = 'build %s: phony\n\n' % depstr
outfile.write(buildregen)
+
+ ignore_missing = 'build %s: phony\n\n' % depstr
outfile.write(ignore_missing)
class ShellGenerator(Generator):
diff --git a/run_tests.py b/run_tests.py
index eb44bd9..2046509 100755
--- a/run_tests.py
+++ b/run_tests.py
@@ -19,15 +19,15 @@ import os, subprocess, shutil, sys
test_build_dir = 'work area'
install_dir = os.path.join(os.path.split(os.path.abspath(__file__))[0], 'install dir')
-use_shell = len(sys.argv) == 1
+use_shell = len(sys.argv) > 1
builder_command = './builder.py'
if use_shell:
- generator_flags = []
+ generator_flags = ['--generator', 'shell']
compile_commands = ['compile.sh']
test_commands = ['run_tests.sh']
install_commands = ['install.sh']
else:
- generator_flags = ['--generator', 'ninja']
+ generator_flags = []
compile_commands = ['ninja']
test_commands = ['ninja', 'test']
install_commands = ['ninja', 'install']
@@ -38,8 +38,8 @@ def run_test(testdir):
os.mkdir(test_build_dir)
os.mkdir(install_dir)
print('Running test: ' + testdir)
- p = subprocess.Popen([builder_command, '--prefix', install_dir, testdir, test_build_dir] +\
- generator_flags)
+ gen_command = [builder_command, '--prefix', install_dir, testdir, test_build_dir] + generator_flags
+ p = subprocess.Popen(gen_command)
p.wait()
if p.returncode != 0:
raise RuntimeError('Generating the build system failed.')