Add simdjson wrap file and meson scripts

This commit is contained in:
King_DuckZ 2020-08-28 01:07:12 +01:00
parent 6b41e08403
commit 85f7ac321e
6 changed files with 64 additions and 0 deletions

1
.gitignore vendored
View file

@ -5,3 +5,4 @@ links.txt
*.bin
subprojects/curlcpp/
subprojects/SQLiteCpp/
subprojects/simdjson

View file

@ -13,6 +13,10 @@ curlcpp_dep = dependency('curlcpp', version: '>=1.4',
],
)
simdjson_dep = dependency('simdjson', version: '>=0.5.0',
fallback: ['simdjson', 'simdjson_dep'],
)
if not get_option('with_sqlite').disabled()
sqlitecpp_dep = dependency('sqlitecpp', version: '>=3.0.0',
fallback: ['SQLiteCpp', 'sqlitecpp_dep'],
@ -73,6 +77,8 @@ lib_deps = [
ev_dep,
threads_dep,
boost_dep,
curlcpp_dep,
simdjson_dep,
] + backend_libs
executable(meson.project_name(),

View file

@ -0,0 +1,31 @@
project('simdjson', 'cpp',
version: '0.5.0',
meson_version: '>=0.49.2',
default_options: ['buildtype=release', 'cpp_std=c++17', 'b_ndebug=if-release'],
license: 'Apache',
)
public_incl = include_directories('include')
compiler_opts = []
if not get_option('simdjson_implementation_haswell')
compiler_opts += ['-DSIMDJSON_IMPLEMENTATION_HASWELL=0']
endif
if not get_option('simdjson_implementation_westmere')
compiler_opts += ['-DSIMDJSON_IMPLEMENTATION_WESTMERE=0']
endif
if not get_option('simdjson_implementation_arm64')
compiler_opts += ['-DSIMDJSON_IMPLEMENTATION_ARM64=0']
endif
if not get_option('simdjson_implementation_fallback')
compiler_opts += ['-DSIMDJSON_IMPLEMENTATION_FALLBACK=0']
endif
if not get_option('simdjson_exceptions')
compiler_opts += ['-DSIMDJSON_EXCEPTIONS=0']
endif
thread_dep = dependency('threads', required: get_option('simdjson_enable_threads'))
if thread_dep.found()
compiler_opts += ['-DSIMDJSON_THREADS_ENABLED=1']
endif
subdir('src')

View file

@ -0,0 +1,6 @@
option('simdjson_implementation_haswell', type: 'boolean', value: true, description: 'Include the haswell implementation')
option('simdjson_implementation_westmere', type: 'boolean', value: true, description: 'Include the westmere implementation')
option('simdjson_implementation_arm64', type: 'boolean', value: true, description: 'Include the arm64 implementation')
option('simdjson_implementation_fallback', type: 'boolean', value: true, description: 'Include the fallback implementation')
option('simdjson_exceptions', type: 'boolean', value: true, description: 'Enable simdjson\'s exception-throwing interface')
option('simdjson_enable_threads', type: 'feature', value: 'auto', description: 'Link with thread support')

View file

@ -0,0 +1,13 @@
simdjson = static_library(meson.project_name(),
'simdjson.cpp',
'error.cpp',
include_directories: public_incl,
install: true,
cpp_args: compiler_opts,
dependencies: [thread_dep],
)
simdjson_dep = declare_dependency(
link_with: simdjson,
include_directories: public_incl,
)

View file

@ -0,0 +1,7 @@
[wrap-git]
url = https://github.com/simdjson/simdjson.git
revision = 5d355f1a8b584519ed39256c3be949ef7f8b0dbd
patch_directory = simdjson
[provide]
dependency_names = simdjson-0.5.0