[gnome-usage] build: Use meson's conventions
- From: Petr Štětka <pstetka src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-usage] build: Use meson's conventions
- Date: Thu, 21 Dec 2017 17:30:30 +0000 (UTC)
commit 2d7ae3e7a7ad24cef8e81fa1645a84bf24315129
Author: Iñigo Martínez <inigomartinez gmail com>
Date: Wed Dec 20 17:32:40 2017 +0100
build: Use meson's conventions
The convention when naming dependencies is to use the '_dep' suffix,
which helps detecting dependency variables. The variables have been
renamed to follow this convention. The dependencies that are also
used once, are declared in the target's dependency array which helps
meson processing less and also one less variable is needed.
There is also a convention when naming libraries which is by using
the `lib` prefix. The libraries have renamed accordingly.
Finally, usually a 2 space indentation is used. This has also been
changed.
external/egg/meson.build | 81 ++++++++++++++++++++++---------------
external/rg/meson.build | 40 +++++++++++++------
meson.build | 11 ++----
src/meson.build | 101 ++++++++++++++++++++++++-----------------------
4 files changed, 131 insertions(+), 102 deletions(-)
---
diff --git a/external/egg/meson.build b/external/egg/meson.build
index c48e842..ac09c3c 100644
--- a/external/egg/meson.build
+++ b/external/egg/meson.build
@@ -1,35 +1,52 @@
+egg_inc = include_directories('.')
+
sources = [
- 'egg-animation.c',
- 'egg-binding-group.c',
- 'egg-box.c',
- 'egg-centering-bin.c',
- 'egg-column-layout.c',
- 'egg-counter.c',
- 'egg-date-time.c',
- 'egg-empty-state.c',
- 'egg-entry-box.c',
- 'egg-file-chooser-entry.c',
- 'egg-frame-source.c',
- 'egg-heap.c',
- 'egg-list-box.c',
- 'egg-menu-manager.c',
- 'egg-pill-box.c',
- 'egg-priority-box.c',
- 'egg-radio-box.c',
- 'egg-scrolled-window.c',
- 'egg-search-bar.c',
- 'egg-settings-flag-action.c',
- 'egg-settings-sandwich.c',
- 'egg-signal-group.c',
- 'egg-simple-label.c',
- 'egg-simple-popover.c',
- 'egg-slider.c',
- 'egg-state-machine-buildable.c',
- 'egg-state-machine.c',
- 'egg-task-cache.c',
- 'egg-three-grid.c',
- 'egg-widget-action-group.c']
+ 'egg-animation.c',
+ 'egg-binding-group.c',
+ 'egg-box.c',
+ 'egg-centering-bin.c',
+ 'egg-column-layout.c',
+ 'egg-counter.c',
+ 'egg-date-time.c',
+ 'egg-empty-state.c',
+ 'egg-entry-box.c',
+ 'egg-file-chooser-entry.c',
+ 'egg-frame-source.c',
+ 'egg-heap.c',
+ 'egg-list-box.c',
+ 'egg-menu-manager.c',
+ 'egg-pill-box.c',
+ 'egg-priority-box.c',
+ 'egg-radio-box.c',
+ 'egg-scrolled-window.c',
+ 'egg-search-bar.c',
+ 'egg-settings-flag-action.c',
+ 'egg-settings-sandwich.c',
+ 'egg-signal-group.c',
+ 'egg-simple-label.c',
+ 'egg-simple-popover.c',
+ 'egg-slider.c',
+ 'egg-state-machine-buildable.c',
+ 'egg-state-machine.c',
+ 'egg-task-cache.c',
+ 'egg-three-grid.c',
+ 'egg-widget-action-group.c'
+]
+
+deps = [
+ gio_dep,
+ glib_dep,
+ gobject_dep,
+ gtk_dep
+]
-egg_lib = static_library( 'egg', sources, dependencies : [glib, gobject, gio, gtk], install : false)
+libegg = static_library(
+ 'egg',
+ sources: sources,
+ dependencies: deps
+)
-egg = declare_dependency(link_with : egg_lib, include_directories : include_directories('.'))
+libegg_dep = declare_dependency(
+ link_with: libegg,
+ include_directories: egg_inc
+)
diff --git a/external/rg/meson.build b/external/rg/meson.build
index baae057..6c222a4 100644
--- a/external/rg/meson.build
+++ b/external/rg/meson.build
@@ -1,16 +1,30 @@
sources = [
- 'rg-column.c',
- 'rg-cpu-graph.c',
- 'rg-cpu-table.c',
- 'rg-graph.c',
- 'rg-line-renderer.c',
- 'rg-stacked-renderer.c',
- 'rg-renderer.c',
- 'rg-ring.c',
- 'rg-table.c']
+ 'rg-column.c',
+ 'rg-cpu-graph.c',
+ 'rg-cpu-table.c',
+ 'rg-graph.c',
+ 'rg-line-renderer.c',
+ 'rg-stacked-renderer.c',
+ 'rg-renderer.c',
+ 'rg-ring.c',
+ 'rg-table.c'
+]
-rg_lib = static_library( 'rg', sources, dependencies : [glib, gobject, gio, gtk],
- include_directories : include_directories('../egg'), install : false)
+deps = [
+ gio_dep,
+ glib_dep,
+ gobject_dep,
+ gtk_dep
+]
-rg = declare_dependency(link_with : rg_lib,
- include_directories : include_directories('.'))
+librg = static_library(
+ 'rg',
+ sources: sources,
+ dependencies: deps,
+ include_directories: egg_inc
+)
+
+librg_dep = declare_dependency(
+ link_with: librg,
+ include_directories: include_directories('.')
+)
diff --git a/meson.build b/meson.build
index 41c503c..eff0ea1 100644
--- a/meson.build
+++ b/meson.build
@@ -8,13 +8,10 @@ project(
cc = meson.get_compiler('c')
valac = meson.get_compiler('vala')
-glib = dependency('glib-2.0', version : '>=2.38')
-gobject = dependency('gobject-2.0')
-gio = dependency('gio-2.0')
-gtk = dependency('gtk+-3.0', version : '>=3.20.10')
-gtop = dependency('libgtop-2.0', version : '>=2.34.0')
-accountsservice = dependency('accountsservice', version: '>= 0.6.40')
-math = cc.find_library('m')
+glib_dep = dependency('glib-2.0', version : '>=2.38')
+gobject_dep = dependency('gobject-2.0')
+gio_dep = dependency('gio-2.0')
+gtk_dep = dependency('gtk+-3.0', version : '>=3.20.10')
gnome = import('gnome')
i18n = import('i18n')
diff --git a/src/meson.build b/src/meson.build
index 5fb3db1..1152112 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,56 +1,57 @@
vala_sources = [
- 'application.vala',
- 'color-rectangle.vala',
- 'cpu-graph-table.vala',
- 'cpu-graph.vala',
- 'cpu-monitor.vala',
- 'cpu-sub-view.vala',
- 'gnome-usage.vala',
- 'graph-block-row.vala',
- 'graph-block.vala',
- 'graph-box.vala',
- 'graph-stack-switcher.vala',
- 'graph-switcher-button.vala',
- 'header-bar.vala',
- 'memory-graph-table.vala',
- 'memory-graph.vala',
- 'memory-monitor.vala',
- 'memory-speedometer.vala',
- 'memory-sub-view.vala',
- 'monitor.vala',
- 'no-results-found-view.vala',
- 'performance-view.vala',
- 'pie-chart.vala',
- 'process-list-box.vala',
- 'process-row.vala',
- 'process.vala',
- 'quit-process-dialog.vala',
- 'settings.vala',
- 'speedometer.vala',
- 'storage-actionbar.vala',
- 'storage-analyzer.vala',
- 'storage-graph.vala',
- 'storage-item.vala',
- 'storage-list-box.vala',
- 'storage-row.vala',
- 'storage-view.vala',
- 'storage-worker.vala',
- 'swap-speedometer.vala',
- 'system-monitor.vala',
- 'utils.vala',
- 'view.vala',
- 'window.vala']
+ 'application.vala',
+ 'color-rectangle.vala',
+ 'cpu-graph-table.vala',
+ 'cpu-graph.vala',
+ 'cpu-monitor.vala',
+ 'cpu-sub-view.vala',
+ 'gnome-usage.vala',
+ 'graph-block-row.vala',
+ 'graph-block.vala',
+ 'graph-box.vala',
+ 'graph-stack-switcher.vala',
+ 'graph-switcher-button.vala',
+ 'header-bar.vala',
+ 'memory-graph-table.vala',
+ 'memory-graph.vala',
+ 'memory-monitor.vala',
+ 'memory-speedometer.vala',
+ 'memory-sub-view.vala',
+ 'monitor.vala',
+ 'no-results-found-view.vala',
+ 'performance-view.vala',
+ 'pie-chart.vala',
+ 'process-list-box.vala',
+ 'process-row.vala',
+ 'process.vala',
+ 'quit-process-dialog.vala',
+ 'settings.vala',
+ 'speedometer.vala',
+ 'storage-actionbar.vala',
+ 'storage-analyzer.vala',
+ 'storage-graph.vala',
+ 'storage-item.vala',
+ 'storage-list-box.vala',
+ 'storage-row.vala',
+ 'storage-view.vala',
+ 'storage-worker.vala',
+ 'swap-speedometer.vala',
+ 'system-monitor.vala',
+ 'utils.vala',
+ 'view.vala',
+ 'window.vala'
+]
deps = [
- accountsservice,
- egg,
- gio,
- glib,
- gobject,
- gtk,
- gtop,
- math,
- rg,
+ gio_dep,
+ glib_dep,
+ gobject_dep,
+ gtk_dep,
+ libegg_dep,
+ librg_dep,
+ dependency('accountsservice', version: '>= 0.6.40'),
+ dependency('libgtop-2.0', version : '>= 2.34.0'),
+ cc.find_library('m'),
valac.find_library('config', dirs: vapi_dir),
valac.find_library('egg', dirs: vapi_dir),
valac.find_library('posix'),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]