[devhelp] meson: generate config.h and compile more libdevhelp files



commit a123c73c1e968b54b6e9ecc1ed3e030b7b50cb05
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sun Mar 11 09:04:06 2018 +0100

    meson: generate config.h and compile more libdevhelp files
    
    Define DATADIR in config.h, and #include "config.h" in dh-util-lib.c. To
    have all such variables in config.h for consistency.

 devhelp/dh-util-lib.c |    1 +
 devhelp/meson.build   |   31 ++++++++++++++++++++++++++++---
 meson.build           |   21 +++++++++++++++++++++
 3 files changed, 50 insertions(+), 3 deletions(-)
---
diff --git a/devhelp/dh-util-lib.c b/devhelp/dh-util-lib.c
index f660f29..10bb2b3 100644
--- a/devhelp/dh-util-lib.c
+++ b/devhelp/dh-util-lib.c
@@ -18,6 +18,7 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "config.h"
 #include "dh-util-lib.h"
 #include "dh-link.h"
 
diff --git a/devhelp/meson.build b/devhelp/meson.build
index 58a57fe..e4cc40d 100644
--- a/devhelp/meson.build
+++ b/devhelp/meson.build
@@ -1,13 +1,38 @@
 libdevhelp_public_headers = [
-        'dh-completion.h'
+        'dh-book.h',
+        'dh-book-manager.h',
+        'dh-completion.h',
+        'dh-init.h',
+        'dh-link.h'
 ]
 
 libdevhelp_public_c_files = [
-        'dh-completion.c'
+        'dh-book.c',
+        'dh-book-manager.c',
+        'dh-completion.c',
+        'dh-init.c',
+        'dh-link.c'
+]
+
+libdevhelp_private_headers = [
+        'dh-error.h',
+        'dh-parser.h',
+        'dh-settings.h',
+        'dh-util-lib.h'
+]
+
+libdevhelp_private_c_files = [
+        'dh-error.c',
+        'dh-parser.c',
+        'dh-settings.c',
+        'dh-util-lib.c'
 ]
 
 library('devhelp-3',
         [libdevhelp_public_headers,
-         libdevhelp_public_c_files],
+         libdevhelp_public_c_files,
+         libdevhelp_private_headers,
+         libdevhelp_private_c_files],
         dependencies : DEVHELP_DEPS,
+        include_directories : [CONFIG_H_INCLUDE_DIR, ROOT_INCLUDE_DIR],
         install : true)
diff --git a/meson.build b/meson.build
index 0e0ae50..ee6ae4e 100644
--- a/meson.build
+++ b/meson.build
@@ -14,6 +14,27 @@ DEVHELP_DEPS = [
         dependency('gsettings-desktop-schemas')
 ]
 
+# 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')))
+
+configure_file(output : 'config.h',
+               configuration : config_data)
+
+CONFIG_H_INCLUDE_DIR = include_directories('.')
+
+# Misc
+
+# For #include <devhelp/something.h>
+ROOT_INCLUDE_DIR = include_directories('.')
+
 add_global_arguments('-DG_LOG_DOMAIN="@0@"'.format(meson.project_name()),
                      language : 'c')
 


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