From b94dc9f61246ebfe59f81c3d0fc476e7a70689e2 Mon Sep 17 00:00:00 2001 From: Falk Werner Date: Sun, 24 May 2020 21:43:14 +0200 Subject: [PATCH 1/3] added option to prevent installation --- meson.build | 16 ++++++++++++++-- meson_options.txt | 1 + 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 meson_options.txt diff --git a/meson.build b/meson.build index f2b8c01..0bc537b 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,7 @@ project('webfuse', 'c', 'cpp', version: '0.3.0', license: 'LGPL-3.0+') +without_install = get_option('without_install') + 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']) @@ -41,7 +43,9 @@ 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 @@ -75,13 +79,15 @@ 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: true) + install: not without_install) 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') @@ -93,6 +99,8 @@ pkg_config.generate( filebase: 'webfuse_provider', description: 'Provider library for websockets filesystem') +endif + # Webfuse adapter webfuse_adapter_static = static_library('webfuse_adapter', @@ -130,13 +138,15 @@ 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: true) + install: not without_install) 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') @@ -148,6 +158,8 @@ pkg_config.generate( filebase: 'webfuse_adapter', description: 'Websockets filesystem server library') +endif + # Unit Tests fscheck = executable('fs_check', diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..e1a77c3 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1 @@ +option('without_install', type: 'boolean', value: false, description: 'skip installation shared libraries, headers and pkg-config files') From 273e56bd636ae9243db8b8b6b536058cc7a1d784 Mon Sep 17 00:00:00 2001 From: Falk Werner Date: Mon, 25 May 2020 19:55:09 +0200 Subject: [PATCH 2/3] added build options for meson --- doc/build.md | 27 ++++++++++++++++++++++----- meson.build | 31 +++++++++++++++++++------------ meson_options.txt | 4 +++- 3 files changed, 44 insertions(+), 18 deletions(-) diff --git a/doc/build.md b/doc/build.md index 3aa6bec..a100114 100644 --- a/doc/build.md +++ b/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