Ui rule too, and store rules in the backend object.

pull/15/head
Jussi Pakkanen 12 years ago
parent a869da185f
commit 8f63a4ff81
  1. 5
      backends.py
  2. 7
      dependencies.py

@ -18,6 +18,7 @@ import os, sys, re, pickle
import interpreter, nodes
import environment
from meson_install import InstallData
from interpreter import InvalidArguments
if environment.is_windows():
quote_char = '"'
@ -96,6 +97,7 @@ class Backend():
self.environment = build.environment
self.interpreter = interp
self.processed_targets = {}
self.dep_rules = {}
self.build_to_src = os.path.relpath(self.environment.get_source_dir(),
self.environment.get_build_dir())
@ -433,6 +435,9 @@ class NinjaBackend(Backend):
outfile.write(' command = %s\n' % command)
desc = rule.description.replace('@INFILE@', '$in')
outfile.write(' description = %s\n' % desc)
if rule.src_keyword in self.dep_rules:
raise InvalidArguments('Multiple rules for keyword %s.' % rule.src_keyword)
self.dep_rules[rule.src_keyword] = rule
outfile.write('\n')
def generate_rules(self, outfile):

@ -331,9 +331,12 @@ class Qt5Dependency(Dependency):
def get_generate_rules(self):
moc_rule = CustomRule([self.moc.get_command(), '@INFILE@', '-o', '@OUTFILE@'],
'moc_%BASENAME%.cpp','moc_headers', 'moc_compile',
'moc_%BASENAME%.cpp', 'moc_headers', 'moc_compile',
'Compiling @INFILE@ with the moc preprocessor')
return [moc_rule]
ui_rule = CustomRule([self.uic.get_command(), '@INFILE@', '-o', '@OUTFILE@'],
'ui_%BASENAME%.h', 'ui_files', 'ui_compile',
'Compiling @INFILE@ with the ui compiler')
return [moc_rule, ui_rule]
def get_dep_identifier(name, kwargs):

Loading…
Cancel
Save