aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-02-14 00:11:37 +0100
committerThomas White <taw@physics.org>2019-02-14 00:11:37 +0100
commit7b9d04f56c0e22abaeec8dc779bd0800b0d93f79 (patch)
tree4116714a1618adb7834dd96892326a7c74de6dbf /meson.build
parent079bd1d6843aa9a89df9f2c3e2e4a42c56794b64 (diff)
Move parser to separate library
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build21
1 files changed, 17 insertions, 4 deletions
diff --git a/meson.build b/meson.build
index 759fa0b..7e6ac83 100644
--- a/meson.build
+++ b/meson.build
@@ -27,13 +27,17 @@ gresources = gnome.compile_resources('colloquium-resources',
'data/colloquium.gresource.xml',
source_dir: 'data', c_name: 'colloquium')
+
+# libstorycode
+libstorycode_includes = include_directories('libstorycode')
+
flex = find_program('flex')
bison = find_program('bison')
storycode_tab_ch = custom_target('storycode.tab.c',
output : ['storycode.tab.c',
'storycode.tab.h'],
- input : 'src/storycode.y',
+ input : 'libstorycode/storycode.y',
command : [bison, '--defines=@OUTPUT1@',
'-p', 'sc',
'--report=all',
@@ -42,18 +46,27 @@ storycode_tab_ch = custom_target('storycode.tab.c',
storycode_c = custom_target('storycode.c',
output : ['storycode.c', 'storycode.h'],
- input : ['src/storycode.l', storycode_tab_ch],
+ input : ['libstorycode/storycode.l', storycode_tab_ch],
command : [flex, '--outfile=@OUTPUT0@',
'--header-file=@OUTPUT1@',
'-P', 'sc',
'@INPUT@'])
+libstorycode = library('storycode',
+ ['libstorycode/narrative.c',
+ storycode_c,
+ ],
+ include_directories : libstorycode_includes,
+ install : true)
+
+libstorycode_dep = declare_dependency(include_directories : libstorycode_includes,
+ link_with : libstorycode)
+
executable('sc2_test',
['src/sc2_test.c',
- storycode_c,
],
gresources,
- dependencies : [gtkdep])
+ dependencies : [gtkdep, libstorycode_dep])
# Main program
executable('colloquium',