From b93b5347e21fa16ea8176223dd003774cec978e5 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sat, 19 Jun 2021 19:18:36 +0200 Subject: 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. --- meson.build | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) (limited to 'meson.build') 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) -- cgit v1.2.3