aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-02-14 16:20:27 +0100
committerThomas White <taw@physics.org>2019-02-14 16:20:27 +0100
commited54079dcd5ae5d6b801b9a0ea2f3ba013c08c0d (patch)
tree0b4382661e2c2491e22fb4505335b3b130f1b55e /meson.build
parent1b2cea0191cf26ec3206520a70177d16f4f421f0 (diff)
Use generators for flex/bison
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build31
1 files changed, 16 insertions, 15 deletions
diff --git a/meson.build b/meson.build
index f2b902f..2dc827d 100644
--- a/meson.build
+++ b/meson.build
@@ -34,21 +34,21 @@ libstorycode_includes = include_directories('libstorycode')
flex = find_program('flex')
bison = find_program('bison')
-storycode_parse_ch = custom_target('storycode_parse.c',
- output : ['storycode_parse.c',
- 'storycode_parse.h'],
- input : 'libstorycode/storycode.y',
- command : [bison, '--defines=@OUTPUT1@',
- '--report=all',
- '--output=@OUTPUT0@',
- '@INPUT@'])
-
-storycode_lex_c = custom_target('storycode_lex.c',
- output : ['storycode_lex.c', 'storycode_lex.h'],
- input : ['libstorycode/storycode.l', storycode_parse_ch],
- command : [flex, '--outfile=@OUTPUT0@',
- '--header-file=@OUTPUT1@',
- '@INPUT@'])
+flex_gen = generator(flex,
+ output : ['@BASENAME@_lex.c', '@BASENAME@_lex.h'],
+ arguments : ['--outfile=@OUTPUT0@',
+ '--header-file=@OUTPUT1@',
+ '@INPUT@'])
+
+bison_gen = generator(bison,
+ output : ['@BASENAME@_parse.c', '@BASENAME@_parse.h'],
+ arguments : ['--defines=@OUTPUT1@',
+ '--report=all',
+ '--output=@OUTPUT0@',
+ '@INPUT@'])
+
+storycode_lex_c = flex_gen.process('libstorycode/storycode.l')
+storycode_parse_ch = bison_gen.process('libstorycode/storycode.y')
libstorycode = library('storycode',
['libstorycode/narrative.c',
@@ -57,6 +57,7 @@ libstorycode = library('storycode',
'libstorycode/stylesheet.c',
'libstorycode/storycode.c',
storycode_lex_c,
+ storycode_parse_ch,
],
include_directories : libstorycode_includes,
install : true)