diff options
| author | Michael Forney <mforney@mforney.org> | 2019-09-19 20:40:57 -0700 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2019-09-19 20:41:23 -0700 |
| commit | 71e6699d92b216d83f39c6b99ad97f6ee74cc69f (patch) | |
| tree | c575a8b8404f46f8cc5fad26d231ae3de0a4e98f | |
| parent | a9a4415ee61ed549c46742238fb930e3760edae3 (diff) | |
Use table to control waylandproto outputs
| -rw-r--r-- | ninja.lua | 14 | ||||
| -rw-r--r-- | pkg/mpv/gen.lua | 5 | ||||
| -rw-r--r-- | pkg/swc/gen.lua | 6 | ||||
| -rw-r--r-- | pkg/velox/gen.lua | 9 | ||||
| -rw-r--r-- | pkg/wayland-protocols/gen.lua | 20 |
5 files changed, 31 insertions, 23 deletions
@@ -359,16 +359,16 @@ function yacc(name, gram) }) end -function waylandproto(proto, client, server, code, args) +function waylandproto(proto, outs, args) proto = '$srcdir/'..proto - code = '$outdir/'..code - if client then - build('waylandproto', '$outdir/'..client, proto, {type='client-header'}) + if outs.client then + build('waylandproto', '$outdir/'..outs.client, proto, {type='client-header'}) end - if server then - build('waylandproto', '$outdir/'..server, proto, {type='server-header'}) + if outs.server then + build('waylandproto', '$outdir/'..outs.server, proto, {type='server-header'}) end - if code then + if outs.code then + local code = '$outdir/'..outs.code build('waylandproto', code, proto, {type='code'}) cc(code, {'pkg/wayland/headers'}, args) end diff --git a/pkg/mpv/gen.lua b/pkg/mpv/gen.lua index 9fc2d075..36268e07 100644 --- a/pkg/mpv/gen.lua +++ b/pkg/mpv/gen.lua @@ -36,7 +36,10 @@ pkg.deps = { build('copy', '$outdir/video/out/wayland/xdg-shell.h', '$builddir/pkg/wayland-protocols/include/xdg-shell-client-protocol.h') build('copy', '$outdir/video/out/wayland/idle-inhibit-v1.h', '$builddir/pkg/wayland-protocols/include/idle-inhibit-unstable-v1-client-protocol.h') -waylandproto('video/out/wayland/server-decoration.xml', 'video/out/wayland/srv-decor.h', nil, 'video/out/wayland/srv-decor.c') +waylandproto('video/out/wayland/server-decoration.xml', { + client='video/out/wayland/srv-decor.h', + code='video/out/wayland/srv-decor.c', +}) rule('file2string', '$outdir/file2string $in >$out.tmp && mv $out.tmp $out') local function file2string(out, inp) diff --git a/pkg/swc/gen.lua b/pkg/swc/gen.lua index a65cbd3c..6c163738 100644 --- a/pkg/swc/gen.lua +++ b/pkg/swc/gen.lua @@ -18,7 +18,11 @@ cflags{ cc('launch/protocol.c') -waylandproto('protocol/swc.xml', 'include/swc-client-protocol.h', 'include/swc-server-protocol.h', 'swc-protocol.c') +waylandproto('protocol/swc.xml', { + client='include/swc-client-protocol.h', + server='include/swc-server-protocol.h', + code='swc-protocol.c', +}) pkg.hdrs = { copy('$outdir/include', '$srcdir/libswc', {'swc.h'}), diff --git a/pkg/velox/gen.lua b/pkg/velox/gen.lua index 439a5fb8..a48e0a6c 100644 --- a/pkg/velox/gen.lua +++ b/pkg/velox/gen.lua @@ -9,10 +9,11 @@ cflags{ '-I $builddir/pkg/wld/include', } -waylandproto('protocol/velox.xml', - 'protocol/velox-client-protocol.h', - 'protocol/velox-server-protocol.h', - 'velox-protocol.c') +waylandproto('protocol/velox.xml', { + client='protocol/velox-client-protocol.h', + server='protocol/velox-server-protocol.h', + code='velox-protocol.c', +}) build('copy', '$outdir/protocol/swc-client-protocol.h', '$builddir/pkg/swc/include/swc-client-protocol.h') pkg.deps = { diff --git a/pkg/wayland-protocols/gen.lua b/pkg/wayland-protocols/gen.lua index 75d4425e..443d8a69 100644 --- a/pkg/wayland-protocols/gen.lua +++ b/pkg/wayland-protocols/gen.lua @@ -1,16 +1,16 @@ cflags{'-I $builddir/pkg/wayland/include'} -waylandproto('stable/xdg-shell/xdg-shell.xml', - 'include/xdg-shell-client-protocol.h', - 'include/xdg-shell-server-protocol.h', - 'xdg-shell-protocol.c' -) +waylandproto('stable/xdg-shell/xdg-shell.xml', { + client='include/xdg-shell-client-protocol.h', + server='include/xdg-shell-server-protocol.h', + code='xdg-shell-protocol.c', +}) -waylandproto('unstable/idle-inhibit/idle-inhibit-unstable-v1.xml', - 'include/idle-inhibit-unstable-v1-client-protocol.h', - 'include/idle-inhibit-unstable-v1-server-protocol.h', - 'idle-inhibit-v1-protocol.c' -) +waylandproto('unstable/idle-inhibit/idle-inhibit-unstable-v1.xml', { + client='include/idle-inhibit-unstable-v1-client-protocol.h', + server='include/idle-inhibit-unstable-v1-server-protocol.h', + code='idle-inhibit-v1-protocol.c' +}) pkg.hdrs = { '$outdir/include/xdg-shell-client-protocol.h', |
