[gnome-sound-recorder/wip/jtojnar/run: 2/2] build: add run target



commit 39e54a99b0114df080518267fef1d579b6707fb2
Author: Jan Tojnar <jtojnar gmail com>
Date:   Fri Jan 18 03:17:14 2019 +0100

    build: add run target
    
    This will allow developers to run the application with `ninja -C build run`
    without installation.

 data/meson.build |  2 +-
 meson.build      |  2 +-
 src/meson.build  | 12 ++++++++++--
 3 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/data/meson.build b/data/meson.build
index 70f58db..dd504b2 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -48,7 +48,7 @@ configure_file(
   install_dir: sound_recorder_schemadir
 )
 
-gnome.compile_resources(
+data_res = gnome.compile_resources(
   application_id + '.data',
   'org.gnome.SoundRecorder.data.gresource.xml',
   gresource_bundle: true,
diff --git a/meson.build b/meson.build
index ec077cb..edcffd4 100644
--- a/meson.build
+++ b/meson.build
@@ -45,8 +45,8 @@ i18n = import('i18n')
 
 po_dir = join_paths(meson.source_root(), 'po')
 
-subdir('src')
 subdir('data')
+subdir('src')
 subdir('po')
 
 meson.add_install_script(
diff --git a/src/meson.build b/src/meson.build
index d915a8f..64c043c 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -5,7 +5,7 @@ app_conf.set('PACKAGE_VERSION', meson.project_version())
 app_conf.set('GJS', gjs_console)
 app_conf.set('APPLICATION_ID', application_id)
 
-configure_file(
+app = configure_file(
   input: 'org.gnome.SoundRecorder.in',
   output: application_id,
   install: true,
@@ -15,7 +15,7 @@ configure_file(
 
 source_res_conf = configuration_data()
 source_res_conf.set('profile', profile)
-gnome.compile_resources(
+src_res = gnome.compile_resources(
   application_id + '.src',
   configure_file(
        input: 'org.gnome.SoundRecorder.src.gresource.xml.in',
@@ -27,3 +27,11 @@ gnome.compile_resources(
   install: true,
   install_dir: sound_recorder_pkgdatadir
 )
+
+run_target('run',
+  command: app,
+  depends: [
+    data_res,
+    src_res,
+  ]
+)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]