mirror of
https://github.com/falk-werner/webfuse-provider
synced 2024-10-27 20:44:10 +00:00
Merge pull request #67 from falk-werner/meson_build
enhanced meson build
This commit is contained in:
commit
1c3ce825a3
21
doc/build.md
21
doc/build.md
@ -22,7 +22,7 @@ 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)
|
||||
@ -33,7 +33,24 @@ _Note: Meson build support is experimental. Do not rely on it._
|
||||
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
|
||||
|
||||
|
32
meson.build
32
meson.build
@ -1,10 +1,17 @@
|
||||
project('webfuse', 'c', 'cpp', version: '0.3.0', license: 'LGPL-3.0+')
|
||||
|
||||
libwebsockets_dep = dependency('libwebsockets', version: '>=4.0.1')
|
||||
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.13', required: false)
|
||||
if not libwebsockets_dep.found()
|
||||
cmake = import('cmake')
|
||||
libwebsockets = cmake.subproject('libwebsockets')
|
||||
libwebsockets_dep = libwebsockets.dependency('websockets_shared')
|
||||
endif
|
||||
|
||||
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')
|
||||
|
||||
@ -45,6 +52,8 @@ install_subdir('include/webfuse/core', install_dir: 'include/webfuse')
|
||||
|
||||
# Webfuse provider
|
||||
|
||||
if not without_provider
|
||||
|
||||
webfuse_provider_static = static_library('webfuse_provider',
|
||||
'lib/webfuse/provider/api.c',
|
||||
'lib/webfuse/provider/impl/url.c',
|
||||
@ -93,8 +102,14 @@ pkg_config.generate(
|
||||
filebase: 'webfuse_provider',
|
||||
description: 'Provider library for websockets filesystem')
|
||||
|
||||
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',
|
||||
@ -148,8 +163,15 @@ pkg_config.generate(
|
||||
filebase: 'webfuse_adapter',
|
||||
description: 'Websockets filesystem server library')
|
||||
|
||||
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')
|
||||
|
||||
@ -258,3 +280,5 @@ alltests = executable('alltests',
|
||||
])
|
||||
|
||||
test('alltests', alltests)
|
||||
|
||||
endif
|
3
meson_options.txt
Normal file
3
meson_options.txt
Normal file
@ -0,0 +1,3 @@
|
||||
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')
|
6
subprojects/libwebsockets.wrap
Normal file
6
subprojects/libwebsockets.wrap
Normal file
@ -0,0 +1,6 @@
|
||||
[wrap-file]
|
||||
directory = libwebsockets-4.0.13
|
||||
|
||||
source_url = https://github.com/warmcat/libwebsockets/archive/v4.0.13.zip
|
||||
source_filename = v4.0.13.zip
|
||||
source_hash = 0914ea3fdec496daf6b6a5c00f7ba1b52eb8cc3d55b66685df92920b232fd7a5
|
Loading…
Reference in New Issue
Block a user