[libgda] meson: simplify SQLite provider build
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] meson: simplify SQLite provider build
- Date: Thu, 7 Mar 2019 23:11:40 +0000 (UTC)
commit 2d3741029258b10ac881d82866c3c068c82f6fc8
Author: Daniel Espinosa Ortiz <esodan gmail com>
Date: Thu Mar 7 16:19:02 2019 -0600
meson: simplify SQLite provider build
libgda/sqlite/meson.build | 44 +++--------------------------------------
meson.build | 19 ++----------------
meson_options.txt | 3 ---
providers/meson.build | 2 +-
providers/sqlcipher/meson.build | 12 +++++------
5 files changed, 11 insertions(+), 69 deletions(-)
---
diff --git a/libgda/sqlite/meson.build b/libgda/sqlite/meson.build
index 8daa49eaa..b698d90ba 100644
--- a/libgda/sqlite/meson.build
+++ b/libgda/sqlite/meson.build
@@ -58,46 +58,8 @@ sqlite_path = ''
sqlite_deps = []
-if sqlite_internal
- sqlite_cargs += sqlite_src_c_args
- sqlitesources += sqlite_src
- inc_sqlite_srch = include_directories ('sqlite-src')
- inc_sqlite_srch_dep = declare_dependency (include_directories : inc_sqlite_srch)
- sqlite_deps += inc_sqlite_srch_dep
- sqlite_deps += sqlite_src_deps
-else
- sqlite_path = sqlite_dep.get_pkgconfig_variable('libdir')
- sqlite_cargs += ['-DHAVE_SQLITE']
- sqlite_deps += sqlite_dep
-endif
+sqlite_path = sqlite_dep.get_pkgconfig_variable('libdir')
+sqlite_cargs += ['-DHAVE_SQLITE']
+sqlite_deps += sqlite_dep
sqlite_cargs += ['-DSEARCH_LIB_PATH="'+sqlite_path+'"']
-
-if libcrypto_dep.found () and not get_option('disable-crypto')
-sqlcipher_deps = []
-
-sqlcipher_sources = []
-sqlcipher_sources += sqlitesources_provider
-sqlcipher_sources += sqliteheaders
-sqlcipher_sources += sqlitehanderbinc
-sqlcipher_sources += sqlitehanderbinh
-
-sqlcipher_cargs = [
- '-include',
- meson.build_root() + '/config.h',
- '-DPNAME="SQLCipher"', '-DCLASS_PREFIX="GdaSQLCipher"',
- '-DSTATIC_SQLITE', '-DSQLITE_HAS_CODEC'
- ]
-
-sqlcipher_path = ''
-if sqlcipher_internal
-else
- sqlcipher_path = sqlcipher_dep.get_pkgconfig_variable('libdir')
- sqlcipher_cargs += ['-DHAVE_SQLITE']
- sqlcipher_deps += sqlcipher_dep
-endif
-
-
-sqlcipher_cargs += ['-DSEARCH_LIB_PATH="'+sqlcipher_path+'"']
-
-endif
\ No newline at end of file
diff --git a/meson.build b/meson.build
index ec8264021..66afb5ab7 100644
--- a/meson.build
+++ b/meson.build
@@ -107,34 +107,19 @@ lbdb_cargs = []
# endforeach
sqlite_dep = dependency ('sqlite3', version: '>= 3.22.0', required: false)
-sqlite_system_required = get_option('system-sqlite')
sqlite_internal = true
if sqlite_dep.found()
sqlite3_table_column_metadata = compiler.has_function('sqlite3_table_column_metadata',
- required: sqlite_system_required,
+ required: true,
dependencies: sqlite_dep)
- if sqlite3_table_column_metadata
- message('Using system installed SQLite library')
- sqlite_internal = false
- else
- message('Using embeded SQLite library')
- endif
endif
sqlcipher_dep = dependency ('sqlcipher', version: '>= 3.4', required: false)
-sqlcipher_system_required = get_option('system-sqlcipher')
-sqlcipher_internal = true
if sqlcipher_dep.found() and not get_option('disable-crypto')
sqlcipher_table_column_metadata = compiler.has_function('sqlite3_table_column_metadata',
- required: sqlcipher_system_required,
+ required: true,
dependencies: sqlcipher_dep)
- if sqlcipher_table_column_metadata
- sqlcipher_internal = false
- message('Using system installed SQLCipher library')
- else
- message('Using embeded SQLCipher library')
- endif
endif
ldl = compiler.find_library('dl', required: false)
diff --git a/meson_options.txt b/meson_options.txt
index e427ae045..b08bed0b2 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -10,11 +10,8 @@ option('with-libsoup', type : 'boolean', value : true, description : 'Enable lib
option('with-libsecret', type : 'boolean', value : false, description : 'Enable libsecret support')
option('with-gnome-keyring', type : 'boolean', value : false, description : 'Enable gnome-keyring support')
option('enable-debug', type : 'boolean', value : false, description : 'Enable debug mode')
-option('system-sqlite', type : 'boolean', value : true, description : 'Use SQLite installed on the system
[default=false')
option('with-examples', type : 'boolean', value : false, description : 'Compile examples [default=false')
-option('system-sqlcipher', type : 'boolean', value : true, description : 'Use SQLCipher installed on the
system [default=false')
option('enable-tools', type : 'boolean', value : false, description : 'Enable build GUI Tools')
option('glade-catalog-dir', type : 'string', value : '', description : 'Use the given directory to install
glade catalog files. If glade is not available this option is ignored. If it is not given the valaue from
pkg-config will be used')
option('glade-pixmap-dir', type : 'string', value : '', description : 'Use the given directory to install
glade pixmap files. If glade is not available this option is ignored. If it is not given the valaue from
pkg-config will be used')
option('enable-gtk-doc', type : 'boolean', value : false, description : 'Enable documentation generation
[default = false]')
-
diff --git a/providers/meson.build b/providers/meson.build
index f7574b873..35655d5bf 100644
--- a/providers/meson.build
+++ b/providers/meson.build
@@ -4,7 +4,7 @@ subdir('reuseable')
subdir('sqlite')
subdir('skel-implementation')
-if libcrypto_dep.found () and not get_option('disable-crypto')
+if sqlcipher_dep.found() and libcrypto_dep.found () and not get_option('disable-crypto')
subdir('sqlcipher')
endif
diff --git a/providers/sqlcipher/meson.build b/providers/sqlcipher/meson.build
index 7c8991869..efaa9356c 100644
--- a/providers/sqlcipher/meson.build
+++ b/providers/sqlcipher/meson.build
@@ -79,13 +79,11 @@ libgda_sqlcipher_sources += sqlcipherheaders
install_headers (sqlcipherheaders, subdir: join_paths(project_package, 'providers', 'sqlcipher'))
-if sqlcipher_internal
-libgda_sqlcipher_sources += files([
- 'sqlite3.h',
- 'sqlite3.c',
- ])
-sqlcipher_deps += ldl
-endif
+sqlcipher_path = sqlcipher_dep.get_pkgconfig_variable('libdir')
+sqlcipher_cargs = ['-DHAVE_SQLITE']
+sqlcipher_deps = [sqlcipher_dep]
+
+sqlcipher_cargs += ['-DSEARCH_LIB_PATH="'+sqlcipher_path+'"']
sqlcipher_cargs += [
'-include',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]