[rygel/wip/meson: 5/34] meson: Add librygel-db



commit c2f4b5ee70238840499bbd3e264ff375caeac503
Author: Jens Georg <mail jensge org>
Date:   Sat May 20 14:11:24 2017 +0200

    meson: Add librygel-db

 meson.build                 | 10 +++++++++-
 src/librygel-db/meson.build | 20 ++++++++++++++++++++
 src/meson.build             |  1 +
 3 files changed, 30 insertions(+), 1 deletion(-)
---
diff --git a/meson.build b/meson.build
index 7c63da0e..f97fc7b7 100644
--- a/meson.build
+++ b/meson.build
@@ -22,7 +22,6 @@ conf.set('PLUGIN_DIR', '"@0@"'.format(rygel_plugindir))
 conf.set('BIG_ICON_DIR', '"@0@"'.format(rygel_bigicondir))
 conf.set('SMALL_ICON_DIR', '"@0@"'.format(rygel_smallicondir))
 conf.set('SYS_CONFIG_DIR', '"@0@"'.format(rygel_sysconfdir))
-configure_file(output: 'config.h', configuration: conf)
 config_include = include_directories('.')
 
 add_global_arguments(['-include','config.h'], language : 'c')
@@ -38,6 +37,7 @@ gupnp_av = dependency('gupnp-av-1.0', version: '>= 0.12.8')
 gupnp_dlna = dependency('gupnp-dlna-2.0', version: '>= 0.9.4')
 soup = dependency('libsoup-2.4', version : '>= 2.44.0')
 mediaart = dependency('libmediaart-2.0', version : '>= 0.7.0')
+sqlite = dependency('sqlite3', version : '>= 3.5')
 
 gstreamer = dependency('gstreamer-1.0', version : '>= 1.0')
 gstreamer_pbu = dependency('gstreamer-pbutils-1.0', version : '>= 1.0')
@@ -52,11 +52,19 @@ typelib_dir = join_paths(get_option('libdir'), 'girepository-1.0')
 
 cc = meson.get_compiler('c')
 math = cc.find_library('m', required: false)
+unistring = cc.find_library('unistring', required: false)
+u8_strcoll_available = cc.has_function('u8_strcoll', dependencies: unistring)
+if u8_strcoll_available
+    conf.set('HAVE_UNISTRING', '1')
+endif
 
 common_deps = [gupnp, gee]
 
 core_deps = common_deps + [gssdp, gio, gmodule, libxml, posix, math]
 renderer_deps = common_deps + [gupnp_av, soup]
 server_deps = common_deps + [gssdp, gupnp_av, soup, mediaart, gmodule, libxml]
+db_deps = common_deps + [gupnp_av, gio, sqlite, unistring]
+
+configure_file(output: 'config.h', configuration: conf)
 
 subdir('src')
diff --git a/src/librygel-db/meson.build b/src/librygel-db/meson.build
new file mode 100644
index 00000000..3e576298
--- /dev/null
+++ b/src/librygel-db/meson.build
@@ -0,0 +1,20 @@
+db_sources = [
+    'database-cursor.vala',
+    'database.vala',
+    'sql-function.vala',
+    'sql-operator.vala',
+    'collate.c'
+]
+
+db_lib = library('rygel-db-2.6', db_sources,
+        dependencies : db_deps + [rygel_core],
+        include_directories: [config_include, include_directories('.')],
+        version: '2.0.4',
+        vala_header : 'rygel-db.h',
+        install: true,
+        install_dir : [true, true, true])
+
+# need to add to get the current build dir as include dir
+rygel_db = declare_dependency(include_directories: include_directories('.'),
+                                dependencies: db_deps,
+                                link_with: db_lib)
diff --git a/src/meson.build b/src/meson.build
index 76e26a9b..64774fb4 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,4 +1,5 @@
 subdir('librygel-core')
+subdir('librygel-db')
 subdir('librygel-renderer')
 subdir('librygel-server')
 subdir('media-engines')


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