summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlastair Poole <netstar@gmail.com>2019-12-10 23:17:16 +0000
committerAlastair Poole <netstar@gmail.com>2019-12-10 23:17:16 +0000
commitc66ef784972a04145f1adda0cc83dad9380b3c33 (patch)
treed3684afc435f7a4fb910a413b0a4ebf93f175e6a
parent6be13a1268f52baae2bbe93a5cd18e32ea12fc3e (diff)
Meson: Use configuration_data.
Meson makes this much easier and prettier. Generate a configure file for future use.
-rw-r--r--meson.build12
-rw-r--r--src/bin/main.c3
-rw-r--r--src/bin/meson.build24
3 files changed, 27 insertions, 12 deletions
diff --git a/meson.build b/meson.build
index 5f005b7..56de4c0 100644
--- a/meson.build
+++ b/meson.build
@@ -1,16 +1,19 @@
1##### Project
1project('evisum', 'c', 2project('evisum', 'c',
2 version: '0.3.0', 3 versioni : '0.3.0',
3 meson_version : '>= 0.40.0') 4 meson_version : '>= 0.40.0')
4 5
5efl_version = '>= 1.22.0' 6efl_version = '>= 1.22.0'
6 7
8cfg = configuration_data()
9
7host_os = host_machine.system() 10host_os = host_machine.system()
8 11
9deps = dependency('elementary', version: efl_version) 12deps = dependency('elementary', version: efl_version)
10 13
11deps_os = declare_dependency(link_args : [] ) 14deps_os = declare_dependency(link_args : [] )
12if host_os == 'openbsd' 15if host_os == 'openbsd'
13deps_os = declare_dependency(link_args : [ '-lkvm' ]) 16 deps_os = declare_dependency(link_args : [ '-lkvm' ])
14endif 17endif
15 18
16##### dir locations 19##### dir locations
@@ -20,5 +23,10 @@ dir_lib = join_paths(dir_prefix, get_option('libdir'))
20dir_data = join_paths(dir_prefix, get_option('datadir')) 23dir_data = join_paths(dir_prefix, get_option('datadir'))
21dir_locale = join_paths(dir_prefix, get_option('localedir')) 24dir_locale = join_paths(dir_prefix, get_option('localedir'))
22 25
26##### config.h
27
28cfg.set_quoted('PACKAGE_VERSION', meson.project_version())
29configure_file(output: 'config.h', configuration: cfg)
30
23subdir('src') 31subdir('src')
24subdir('data') 32subdir('data')
diff --git a/src/bin/main.c b/src/bin/main.c
index fdaff80..0ab0f53 100644
--- a/src/bin/main.c
+++ b/src/bin/main.c
@@ -6,8 +6,7 @@
6 * See LICENSE file for details. 6 * See LICENSE file for details.
7 */ 7 */
8 8
9#define VERSION "0.2.6" 9#include "config.h"
10
11#include "ui.h" 10#include "ui.h"
12 11
13static void 12static void
diff --git a/src/bin/meson.build b/src/bin/meson.build
index 257f6df..8c14247 100644
--- a/src/bin/meson.build
+++ b/src/bin/meson.build
@@ -1,9 +1,17 @@
1inc = include_directories('.', '../..')
2
1executable('evisum', [ 3executable('evisum', [
2 'disks.c', 'disks.h', 4 'disks.c',
3 'process.c', 'process.h', 5 'disks.h',
4 'system.c', 'system.h', 6 'process.c',
5 'ui.c', 'ui.h', 7 'process.h',
6 'main.c'], 8 'system.c',
7 dependencies : [ deps, deps_os ], 9 'system.h',
8 gui_app : true, 10 'ui.c',
9 install : true) 11 'ui.h',
12 'main.c'
13 ],
14 include_directories : inc,
15 dependencies : [ deps, deps_os ],
16 gui_app : true,
17 install : true)