[gnome-power-manager/wip/hughsie/meson] build: trivial fixes



commit 1efcd15c6be8970794cf967f994996b246735b38
Author: Igor Gnatenko <ignatenko src gnome org>
Date:   Wed Nov 30 17:17:53 2016 +0100

    build: trivial fixes
    
    Signed-off-by: Igor Gnatenko <ignatenko src gnome org>

 meson.build     |   23 ++++++++---------------
 src/meson.build |    1 -
 2 files changed, 8 insertions(+), 16 deletions(-)
---
diff --git a/meson.build b/meson.build
index 598ff67..45ab0d4 100644
--- a/meson.build
+++ b/meson.build
@@ -3,18 +3,12 @@
 # Licensed under the GNU General Public License Version 2 or later
 
 project('gnome-power-manager', 'c',
-  default_options : ['warning_level=1'])
-
-version_major = '3'
-version_minor = '22'
-version_micro = '3'
-version = '@0@.@1@.@2@'.format(version_major, version_minor, version_micro)
+        version : '3.22.3',
+        default_options : ['warning_level=1'],
+        meson_version : '>=0.36.0')
 
 conf = configuration_data()
-conf.set('VERSION_MAJOR', version_major)
-conf.set('VERSION_MINOR', version_minor)
-conf.set('VERSION_MICRO', version_micro)
-conf.set('VERSION', '@0@'.format(version))
+conf.set('PACKAGE_VERSION', meson.project_version())
 
 # get suported warning flags
 test_args = [
@@ -62,11 +56,10 @@ test_args = [
   '-Wunused-but-set-variable',
   '-Wwrite-strings'
 ]
-common_c_args = []
 cc = meson.get_compiler('c')
 foreach arg: test_args
   if cc.has_argument(arg)
-    common_c_args += [ arg ]
+    add_project_arguments(arg, language : 'c')
   endif
 endforeach
 
@@ -95,8 +88,8 @@ configure_file(input : 'config.h.in',
                configuration : conf)
 top_build_incdir = include_directories(meson.current_build_dir())
 
-add_global_arguments('-DLOCALEDIR="@0@"'.format(get_option('localedir')), language : 'c')
-add_global_arguments('-DDATA_DIR="@0@"'.format(get_option('datadir')), language : 'c')
+add_project_arguments('-DLOCALEDIR="@0@"'.format(join_paths(get_option('prefix'), get_option('localedir'))), 
language : 'c')
+add_project_arguments('-DDATA_DIR="@0@"'.format(join_paths(get_option('prefix'), get_option('datadir'))), 
language : 'c')
 
 subdir('src')
 subdir('man')
@@ -108,7 +101,7 @@ if archiver.found()
   run_target('dist',
              command: ['git', 'archive', '--prefix=appstream-glib/',
                        'HEAD',
-                       '--output', 'gnome-power-manager-' + version + '.tar.gz']
+                       '--output', 'gnome-power-manager-' + meson.project_version() + '.tar.gz']
   )
 else
   message('git not found, you will not be able to run `ninja dist`')
diff --git a/src/meson.build b/src/meson.build
index 3d88ff5..8253c87 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -3,7 +3,6 @@
 # Licensed under the GNU General Public License Version 2 or later
 
 cargs = ['-DG_LOG_DOMAIN="Gpm"']
-cargs += common_c_args
 
 simple_resources = gnome.compile_resources('simple-resources',
   'gnome-power-manager.gresource.xml',


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