Renamed generator command line option to backend.

pull/15/head
Jussi Pakkanen 12 years ago
parent 7abe15a7ba
commit 7371ad676e
  1. 2
      backends.py
  2. 8
      meson.py
  3. 6
      run_tests.py

@ -301,7 +301,7 @@ class NinjaBackend(Backend):
c = (ninja_quote(self.environment.get_build_command()),
ninja_quote(self.environment.get_source_dir()),
ninja_quote(self.environment.get_build_dir()))
outfile.write(" command = '%s' '%s' '%s' -G ninja\n" % c)
outfile.write(" command = '%s' '%s' '%s' --backend ninja\n" % c)
outfile.write(' description = Regenerating build files\n')
outfile.write(' generator = 1\n\n')

@ -42,8 +42,8 @@ parser.add_option('--datadir', default='share', dest='datadir',
help='relative path to the top of data file subdirectory (default: %default)')
parser.add_option('--mandir' , default='share/man', dest='mandir',
help='relatie path of man files (default: %default)')
parser.add_option('-G', '--generator', default='ninja', dest='generator',
help='the backend generator to use (default: %default)')
parser.add_option('--backend', default='ninja', dest='backend',
help='the backend to use (default: %default)')
parser.add_option('--buildtype', default='debug', type='choice', choices=build_types, dest='buildtype',
help=buildtype_help)
parser.add_option('--strip', action='store_true', dest='strip', default=False,\
@ -92,9 +92,9 @@ class MesonApp():
b = build.Build(env)
intr = interpreter.Interpreter(b)
intr.run()
if options.generator == 'shell':
if options.backend == 'shell':
g = backends.ShellBackend(b, intr)
elif options.generator == 'ninja':
elif options.backend == 'ninja':
g = backends.NinjaBackend(b, intr)
else:
raise RuntimeError('Unknown generator "%s".' % options.generator)

@ -22,12 +22,12 @@ install_dir = os.path.join(os.path.split(os.path.abspath(__file__))[0], 'install
use_shell = len(sys.argv) > 1
meson_command = './meson.py'
if use_shell:
generator_flags = ['--generator', 'shell']
backend_flags = ['--backend', 'shell']
compile_commands = ['compile.sh']
test_commands = ['run_tests.sh']
install_commands = ['install.sh']
else:
generator_flags = []
backend_flags = []
compile_commands = ['ninja']
test_commands = ['ninja', 'test']
install_commands = ['ninja', 'install']
@ -38,7 +38,7 @@ def run_test(testdir):
os.mkdir(test_build_dir)
os.mkdir(install_dir)
print('Running test: ' + testdir)
gen_command = [meson_command, '--prefix', install_dir, testdir, test_build_dir] + generator_flags
gen_command = [meson_command, '--prefix', install_dir, testdir, test_build_dir] + backend_flags
p = subprocess.Popen(gen_command)
p.wait()
if p.returncode != 0:

Loading…
Cancel
Save