[devhelp] meson: try another coding style



commit cdabc3128bc06562cae6cac8be7ac15c7307fa83
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sun Mar 11 14:57:09 2018 +0100

    meson: try another coding style

 devhelp/meson.build    |   55 ++++++++++++++++++++++++++++-------------------
 meson.build            |   38 +++++++++++++++++++++-----------
 unit-tests/meson.build |   10 +++++---
 3 files changed, 64 insertions(+), 39 deletions(-)
---
diff --git a/devhelp/meson.build b/devhelp/meson.build
index 6b8c1d9..7007b25 100644
--- a/devhelp/meson.build
+++ b/devhelp/meson.build
@@ -40,33 +40,44 @@ libdevhelp_private_c_files = [
 ]
 
 install_headers_subdir = 'devhelp-@0@/devhelp'.format(DEVHELP_API_VERSION)
-install_headers_fulldir = join_paths(get_option('prefix'),
-                                     get_option('includedir'),
-                                     install_headers_subdir)
+install_headers_fulldir = join_paths(
+        get_option('prefix'),
+        get_option('includedir'),
+        install_headers_subdir
+)
 
-libdevhelp_enums = GNOME.mkenums_simple('dh-enum-types',
-                                        sources : libdevhelp_public_headers,
-                                        install_header : true,
-                                        install_dir : install_headers_fulldir)
+libdevhelp_enums = GNOME.mkenums_simple(
+        'dh-enum-types',
+        sources : libdevhelp_public_headers,
+        install_header : true,
+        install_dir : install_headers_fulldir
+)
 libdevhelp_enum_header = libdevhelp_enums[1]
 
-libdevhelp_static = static_library('devhelp-static',
-                                   [libdevhelp_public_c_files,
-                                    libdevhelp_private_c_files,
-                                    libdevhelp_enums],
-                                   include_directories : [CONFIG_H_INCLUDE_DIR,
-                                                          ROOT_INCLUDE_DIR],
-                                   dependencies : DEVHELP_DEPS)
+libdevhelp_static = static_library(
+        'devhelp-static',
+        [libdevhelp_public_c_files,
+         libdevhelp_private_c_files,
+         libdevhelp_enums],
+        include_directories : [CONFIG_H_INCLUDE_DIR, ROOT_INCLUDE_DIR],
+        dependencies : DEVHELP_DEPS
+)
 
 # For unit tests, to be able to test private functions.
-LIBDEVHELP_STATIC_DEP = declare_dependency(sources : libdevhelp_enum_header,
-                                           link_with : libdevhelp_static,
-                                           include_directories : [ROOT_INCLUDE_DIR],
-                                           dependencies : DEVHELP_DEPS)
+LIBDEVHELP_STATIC_DEP = declare_dependency(
+        sources : libdevhelp_enum_header,
+        link_with : libdevhelp_static,
+        include_directories : [ROOT_INCLUDE_DIR],
+        dependencies : DEVHELP_DEPS
+)
 
-library('devhelp-@0@'.format(DEVHELP_API_VERSION),
+library(
+        'devhelp-@0@'.format(DEVHELP_API_VERSION),
         link_with : libdevhelp_static,
-        install : true)
+        install : true
+)
 
-install_headers(libdevhelp_public_headers,
-                subdir : install_headers_subdir)
+install_headers(
+        libdevhelp_public_headers,
+        subdir : install_headers_subdir
+)
diff --git a/meson.build b/meson.build
index 4c0ff0c..56c587b 100644
--- a/meson.build
+++ b/meson.build
@@ -3,9 +3,11 @@
 # - Global variables in UPPER_CASE.
 # See: https://github.com/mesonbuild/meson/issues/2607
 
-project('devhelp', 'c',
+project(
+        'devhelp', 'c',
         meson_version : '>= 0.43',
-        version : '3.28.1')
+        version : '3.28.1'
+)
 
 GNOME = import('gnome')
 
@@ -22,16 +24,24 @@ DEVHELP_DEPS = [
 # config.h
 
 config_data = configuration_data()
-config_data.set_quoted('GETTEXT_PACKAGE',
-                       meson.project_name(),
-                       description : 'Define to the gettext package name.')
-config_data.set_quoted('DATADIR',
-                       join_paths(get_option('prefix'), get_option('datadir')))
-config_data.set_quoted('LOCALEDIR',
-                       join_paths(get_option('prefix'), get_option('localedir')))
+config_data.set_quoted(
+        'GETTEXT_PACKAGE',
+        meson.project_name(),
+        description : 'Define to the gettext package name.'
+)
+config_data.set_quoted(
+        'DATADIR',
+        join_paths(get_option('prefix'), get_option('datadir'))
+)
+config_data.set_quoted(
+        'LOCALEDIR',
+        join_paths(get_option('prefix'), get_option('localedir'))
+)
 
-configure_file(output : 'config.h',
-               configuration : config_data)
+configure_file(
+        output : 'config.h',
+        configuration : config_data
+)
 
 CONFIG_H_INCLUDE_DIR = include_directories('.')
 
@@ -40,8 +50,10 @@ CONFIG_H_INCLUDE_DIR = include_directories('.')
 # For #include <devhelp/something.h>
 ROOT_INCLUDE_DIR = include_directories('.')
 
-add_global_arguments('-DG_LOG_DOMAIN="@0@"'.format(meson.project_name()),
-                     language : 'c')
+add_global_arguments(
+        '-DG_LOG_DOMAIN="@0@"'.format(meson.project_name()),
+        language : 'c'
+)
 
 #####
 # CFLAGS
diff --git a/unit-tests/meson.build b/unit-tests/meson.build
index debf7d2..130e51e 100644
--- a/unit-tests/meson.build
+++ b/unit-tests/meson.build
@@ -6,10 +6,12 @@ unit_tests = [
 ]
 
 foreach unit_test : unit_tests
-        exe = executable(unit_test,
-                         unit_test + '.c',
-                         include_directories : ROOT_INCLUDE_DIR,
-                         dependencies : [DEVHELP_DEPS, LIBDEVHELP_STATIC_DEP])
+        exe = executable(
+                unit_test,
+                unit_test + '.c',
+                include_directories : ROOT_INCLUDE_DIR,
+                dependencies : [DEVHELP_DEPS, LIBDEVHELP_STATIC_DEP]
+        )
 
         test(unit_test, exe)
 endforeach


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