diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2013-04-01 18:06:27 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2013-04-01 18:06:27 +0300 |
commit | a869da185f076a81b65ebd55f074a26c6e6b8466 (patch) | |
tree | be3ed630952190e801bbf60b0909578d6f406d31 /dependencies.py | |
parent | 71ce75899a58f400a16fbee803ec0ad6fae6ae40 (diff) | |
download | meson-a869da185f076a81b65ebd55f074a26c6e6b8466.zip meson-a869da185f076a81b65ebd55f074a26c6e6b8466.tar.gz meson-a869da185f076a81b65ebd55f074a26c6e6b8466.tar.bz2 |
Can generate custom rules for dependencies.
Diffstat (limited to 'dependencies.py')
-rw-r--r-- | dependencies.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/dependencies.py b/dependencies.py index f689f8b..d14f68c 100644 --- a/dependencies.py +++ b/dependencies.py @@ -28,6 +28,14 @@ class DependencyException(MesonException): def __init__(self, *args, **kwargs): MesonException.__init__(self, *args, **kwargs) +class CustomRule: + def __init__(self, cmd_list, name_templ, src_keyword, name, description): + self.cmd_list = cmd_list + self.name_templ = name_templ + self.src_keyword = src_keyword + self.name = name + self.description = description + class Dependency(): def __init__(self): self.name = "null" @@ -49,6 +57,11 @@ class Dependency(): def get_name(self): return self.name + # Rules for commands to execute before compilation + # such as Qt's moc preprocessor. + def get_generate_rules(self): + return [] + class PkgConfigDependency(Dependency): pkgconfig_found = False @@ -316,6 +329,13 @@ class Qt5Dependency(Dependency): return False return True + def get_generate_rules(self): + moc_rule = CustomRule([self.moc.get_command(), '@INFILE@', '-o', '@OUTFILE@'], + 'moc_%BASENAME%.cpp','moc_headers', 'moc_compile', + 'Compiling @INFILE@ with the moc preprocessor') + return [moc_rule] + + def get_dep_identifier(name, kwargs): elements = [name] modlist = kwargs.get('modules', []) |