summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build23
1 files changed, 21 insertions, 2 deletions
diff --git a/meson.build b/meson.build
index f2fb038..6017948 100644
--- a/meson.build
+++ b/meson.build
@@ -1,23 +1,42 @@
project(
'djinterop',
'cpp', 'c',
- version: '0.13.0',
+ version: '0.14.0',
license: 'LGPL-3.0',
default_options: ['cpp_std=c++17', 'default_library=both'])
cpp_compiler = meson.get_compiler('cpp')
+
if cpp_compiler.get_id() == 'msvc'
# Ask MSVC to populate the __cplusplus macro properly.
add_global_arguments('/Zc:__cplusplus', language: 'cpp')
endif
+# Set hidden visibility arguments for everything the project, if available.
+if get_option('default_library') != 'static'
+ if cpp_compiler.has_argument('-fvisibility=hidden')
+ add_global_arguments('-fvisibility=hidden', language: ['c', 'cpp'])
+ endif
+endif
+
+
# libdl is "special", not like other dependencies
dl_dep = cpp_compiler.find_library('dl', required: false)
thread_dep = dependency('threads')
-sqlite3_dep = dependency('sqlite3', version: '>=3.11.0', fallback: ['sqlite', 'sqlite_dep'])
zlib_dep = dependency('zlib', version: '>=1.2.8', fallback: ['zlib', 'zlib_dep'])
+# We may either use a system-wide installation of SQLite, or our embedded one.
+if get_option('system_sqlite')
+ sqlite3_dep = dependency('sqlite3', version: '>=3.11.0')
+else
+ message('Using embedded SQLite')
+ sqlite3_dep = declare_dependency(
+ include_directories: 'ext/sqlite-amalgamation',
+ sources: 'ext/sqlite-amalgamation/sqlite3.c',
+ compile_args: ['-DSQLITE_OMIT_LOAD_EXTENSION'],
+ version: '3.33.0')
+endif
sqlite_modern_cpp_dep = declare_dependency(
dependencies: [sqlite3_dep],
include_directories: 'ext/sqlite_modern_cpp')