mirror of
https://github.com/falk-werner/webfuse-provider
synced 2024-10-27 20:44:10 +00:00
added build options for meson
This commit is contained in:
parent
b94dc9f612
commit
273e56bd63
27
doc/build.md
27
doc/build.md
@ -22,18 +22,35 @@ in order to reduce build dependencies.
|
||||
- **WITHOUT_ADAPTER**: omit adapter library
|
||||
`cmake -DWITHOUT_ADAPTER=ON`
|
||||
|
||||
- **WIHTOU_PROVIDER**: omit provider library
|
||||
- **WIHTOUT_PROVIDER**: omit provider library
|
||||
`cmake -DWITHOUT_PROVIDER=ON`
|
||||
|
||||
## Build using Meson (experimental)
|
||||
|
||||
_Note: Meson build support is experimental. Do not rely on it._
|
||||
|
||||
meson .build
|
||||
cd .build
|
||||
ninja build
|
||||
meson .build
|
||||
cd .build
|
||||
ninja build
|
||||
|
||||
_Note: Build options are not supported yet._
|
||||
### Meson Build options
|
||||
|
||||
Build options can be specified during meson setup or later via meson configure.
|
||||
|
||||
meson -D<option>=<value> .build
|
||||
|
||||
The following options are available:
|
||||
|
||||
- **without_tests**: _(boolean)_ diable tests
|
||||
`meson -Dwithout_tests=true .build`
|
||||
|
||||
- **without_adapter**: _(boolean)_ omit adapter library
|
||||
`meson -Dwithout_adapter=true .build`
|
||||
|
||||
- **without_provider**: _(boolean)_ omit provider library
|
||||
`meson -Dwithout_provider=true .build`
|
||||
|
||||
_Note that unit tests are only available, when both libraries are built._
|
||||
|
||||
## Create API documentation
|
||||
|
||||
|
31
meson.build
31
meson.build
@ -1,12 +1,12 @@
|
||||
project('webfuse', 'c', 'cpp', version: '0.3.0', license: 'LGPL-3.0+')
|
||||
|
||||
without_install = get_option('without_install')
|
||||
without_adapter = get_option('without_adapter')
|
||||
without_provider = get_option('without_provider')
|
||||
without_tests = get_option('without_tests') or without_adapter or without_provider
|
||||
|
||||
|
||||
libwebsockets_dep = dependency('libwebsockets', version: '>=4.0.1')
|
||||
jansson_dep = dependency('jansson', version: '>=2.11', fallback: ['jansson', 'jansson_dep'])
|
||||
libfuse_dep = dependency('fuse3', version: '>=3.8.0', fallback: ['fuse3', 'libfuse_dep'])
|
||||
gtest_dep = dependency('gtest', version: '>=1.10.0', fallback: ['gtest', 'gtest_dep'])
|
||||
gmock_main_dep = dependency('gmock_main', version: '>=1.10.0', fallback: ['gtest', 'gmock_main_main_dep'])
|
||||
|
||||
pkg_config = import('pkgconfig')
|
||||
|
||||
@ -43,12 +43,12 @@ webfuse_core_dep = declare_dependency(
|
||||
link_with: webfuse_core,
|
||||
dependencies: [jansson_dep, libwebsockets_dep])
|
||||
|
||||
if not without_install
|
||||
install_subdir('include/webfuse/core', install_dir: 'include/webfuse')
|
||||
endif
|
||||
|
||||
# Webfuse provider
|
||||
|
||||
if not without_provider
|
||||
|
||||
webfuse_provider_static = static_library('webfuse_provider',
|
||||
'lib/webfuse/provider/api.c',
|
||||
'lib/webfuse/provider/impl/url.c',
|
||||
@ -79,15 +79,13 @@ webfuse_provider = shared_library('webfuse_provider',
|
||||
c_args: ['-fvisibility=hidden', '-DWFP_API=WFP_EXPORT'],
|
||||
include_directories: private_inc_dir,
|
||||
dependencies: [webfuse_provider_static_dep],
|
||||
install: not without_install)
|
||||
install: true)
|
||||
|
||||
webfuse_provider_dep = declare_dependency(
|
||||
include_directories: inc_dir,
|
||||
link_with: [webfuse_provider],
|
||||
dependencies: [libwebsockets_dep, jansson_dep])
|
||||
|
||||
if not without_install
|
||||
|
||||
install_headers('include/webfuse_provider.h', subdir: 'webfuse')
|
||||
install_subdir('include/webfuse/provider', install_dir: 'include/webfuse')
|
||||
|
||||
@ -103,6 +101,10 @@ endif
|
||||
|
||||
# Webfuse adapter
|
||||
|
||||
if not without_adapter
|
||||
|
||||
libfuse_dep = dependency('fuse3', version: '>=3.8.0', fallback: ['fuse3', 'libfuse_dep'])
|
||||
|
||||
webfuse_adapter_static = static_library('webfuse_adapter',
|
||||
'lib/webfuse/adapter/api.c',
|
||||
'lib/webfuse/adapter/impl/filesystem.c',
|
||||
@ -138,15 +140,13 @@ webfuse_adapter = shared_library('webfuse_adapter',
|
||||
c_args: ['-fvisibility=hidden', '-DWF_API=WF_EXPORT'],
|
||||
include_directories: private_inc_dir,
|
||||
dependencies: [webfuse_adapter_static_dep, libfuse_dep],
|
||||
install: not without_install)
|
||||
install: true)
|
||||
|
||||
webfuse_adapter_dep = declare_dependency(
|
||||
include_directories: inc_dir,
|
||||
link_with: [webfuse_adapter],
|
||||
dependencies: [libfuse_dep, libwebsockets_dep, jansson_dep])
|
||||
|
||||
if not without_install
|
||||
|
||||
install_headers('include/webfuse_adapter.h', subdir: 'webfuse')
|
||||
install_subdir('include/webfuse/adapter', install_dir: 'include/webfuse')
|
||||
|
||||
@ -162,6 +162,11 @@ endif
|
||||
|
||||
# Unit Tests
|
||||
|
||||
if not without_tests
|
||||
|
||||
gtest_dep = dependency('gtest', version: '>=1.10.0', fallback: ['gtest', 'gtest_dep'])
|
||||
gmock_main_dep = dependency('gmock_main', version: '>=1.10.0', fallback: ['gtest', 'gmock_main_main_dep'])
|
||||
|
||||
fscheck = executable('fs_check',
|
||||
'test/webfuse/tests/integration/fs_check.c')
|
||||
|
||||
@ -270,3 +275,5 @@ alltests = executable('alltests',
|
||||
])
|
||||
|
||||
test('alltests', alltests)
|
||||
|
||||
endif
|
@ -1 +1,3 @@
|
||||
option('without_install', type: 'boolean', value: false, description: 'skip installation shared libraries, headers and pkg-config files')
|
||||
option('without_tests', type: 'boolean', value: false, description: 'disable unit tests')
|
||||
option('without_adapter', type: 'boolean', value: false, description: 'disable adapter library')
|
||||
option('without_provider', type: 'boolean', value: false, description: 'disable provider library')
|
Loading…
Reference in New Issue
Block a user