aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-06-19 19:18:36 +0200
committerThomas White <taw@physics.org>2021-06-19 19:49:05 +0200
commitb93b5347e21fa16ea8176223dd003774cec978e5 (patch)
tree88fbf41603964689fa7d4c99af421bb21c712abc /meson.build
parent6416b2dac6905c1ee48df75fdf42d3f6929785db (diff)
Update meson.build (install Guile files)
Unfortunately, I can't see any practical way, using the build system, to compile the .scm files into .scm.go files in the system 'site-ccache' directory: Using generator objects, the produced objects are explicitly only allowed to be used as input for targets, not to be installed themselves. Using individual custom targets, there would have to be numerous repetitions of the entire kerfuffle required to invoke guild. One target can only process one file. A single custom target running a script which compiles everything - might work, but even that is tricky to get right. And it's completely unportable. For all the above cases, there is still no guarantee that the compiled objects would be installed after the sources, as necessary to prevent spurious recompilation. It doesn't even seem that much easier to do this with Autotools, supposedly the recommended build system for this. Trying to make this work, I've already spent more time than will likely ever be saved by pre-compiling the sources. Let's just install the source files and let Guile automatically compile them into the user cache location.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build37
1 files changed, 22 insertions, 15 deletions
diff --git a/meson.build b/meson.build
index 4b6b87d..dfe81e4 100644
--- a/meson.build
+++ b/meson.build
@@ -1,36 +1,43 @@
# Meson file for Starlet
project('starlet', ['c', 'cpp'],
- version : '0.1.0',
- license : 'GPL3+',
- default_options : ['buildtype=debugoptimized'])
+ version: '0.1.0',
+ license: 'GPL3+',
+ default_options: ['buildtype=debugoptimized'])
+
# Localisation
subdir('po')
add_project_arguments('-DLOCALEDIR="'+join_paths(get_option('prefix'), get_option('localedir'))+'"',
- language : 'c')
+ language: 'c')
# Dependencies
gnome = import('gnome')
cc = meson.get_compiler('c')
-mdep = cc.find_library('m', required : false)
-gtk_dep = dependency('gtk+-3.0', required : true)
-cairo_dep = dependency('cairo', required : true)
-pango_dep = dependency('pango', required : true)
-pangocairo_dep = dependency('pangocairo', required : true)
-guile_dep = dependency('guile-3.0', required : true)
-ola_dep = dependency('libola', required : true)
+gtk_dep = dependency('gtk+-3.0', required: true)
+cairo_dep = dependency('cairo', required: true)
+pango_dep = dependency('pango', required: true)
+pangocairo_dep = dependency('pangocairo', required: true)
+guile_dep = dependency('guile-3.0', required: true)
+ola_dep = dependency('libola', required: true)
+
+# The installation location for Scheme files
+guile_sitedir = guile_dep.get_pkgconfig_variable('sitedir')
# Guile OLA library
library('guile-ola', ['src/guile-ola.cpp'],
- dependencies : [guile_dep, ola_dep],
- install: true)
+ dependencies: [guile_dep, ola_dep],
+ install: true)
# Fixture display tool
executable('starlet-fixture-display',
['src/starlet-fixture-display.c',
'src/repl-connection.c'],
- dependencies : [gtk_dep],
- install : true)
+ dependencies: [gtk_dep, cairo_dep, pango_dep, pangocairo_dep],
+ install: true)
+
+
+# Install Scheme source files (all at once)
+install_subdir('guile/starlet', install_dir: guile_sitedir)