summaryrefslogtreecommitdiffstats
path: root/waftools/generators/sources.py
diff options
context:
space:
mode:
Diffstat (limited to 'waftools/generators/sources.py')
-rw-r--r--waftools/generators/sources.py28
1 files changed, 24 insertions, 4 deletions
diff --git a/waftools/generators/sources.py b/waftools/generators/sources.py
index 6f1521036a..04826932d7 100644
--- a/waftools/generators/sources.py
+++ b/waftools/generators/sources.py
@@ -13,6 +13,9 @@ def __zshcomp_cmd__(ctx, argument):
return '"${{BIN_PERL}}" "{0}/TOOLS/zsh.pl" "{1}" > "${{TGT}}"' \
.format(ctx.srcnode.abspath(), argument)
+def __wayland_scanner_cmd__(ctx, argument):
+ return "${{WAYSCAN}} {0} < ${{SRC}} > ${{TGT}}".format(argument)
+
def __file2string__(ctx, **kwargs):
ctx(
rule = __file2string_cmd__(ctx),
@@ -44,7 +47,24 @@ def __zshcomp__(ctx, **kwargs):
**kwargs
)
-BuildContext.file2string = __file2string__
-BuildContext.matroska_header = __matroska_header__
-BuildContext.matroska_definitions = __matroska_definitions__
-BuildContext.zshcomp = __zshcomp__
+def __wayland_protocol_code__(ctx, **kwargs):
+ ctx(
+ rule = __wayland_scanner_cmd__(ctx, 'code'),
+ name = os.path.basename(kwargs['target']),
+ **kwargs
+ )
+
+def __wayland_protocol_header__(ctx, **kwargs):
+ ctx(
+ rule = __wayland_scanner_cmd__(ctx, 'client-header'),
+ before = ('c',),
+ name = os.path.basename(kwargs['target']),
+ **kwargs
+ )
+
+BuildContext.file2string = __file2string__
+BuildContext.matroska_header = __matroska_header__
+BuildContext.matroska_definitions = __matroska_definitions__
+BuildContext.wayland_protocol_code = __wayland_protocol_code__
+BuildContext.wayland_protocol_header = __wayland_protocol_header__
+BuildContext.zshcomp = __zshcomp__