From fd1f5a25643c2bcc5465d1950a65fed42085ea82 Mon Sep 17 00:00:00 2001 From: Ryo Nakano Date: Tue, 23 Apr 2024 20:24:01 +0900 Subject: [PATCH] meson: Make demo optional --- README.md | 6 ++++-- meson.build | 5 ++++- meson_options.txt | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e9f6406..68555eb 100644 --- a/README.md +++ b/README.md @@ -101,8 +101,10 @@ To install, use `ninja install` ninja install -C builddir ``` -To see a demo app, run: +You can optionally build and run a demo app: ```bash -./build/examples/example +meson configure builddir -Ddemo=true +ninja -C builddir +./builddir/examples/example ``` diff --git a/meson.build b/meson.build index 718f143..20d12ed 100644 --- a/meson.build +++ b/meson.build @@ -14,7 +14,10 @@ libchcase_deps = [ ] subdir('lib') -subdir('examples') + +if get_option('demo') + subdir('examples') +endif if get_option('doc') doc_outdir = 'docs' diff --git a/meson_options.txt b/meson_options.txt index 213182b..d2e3665 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1 +1,2 @@ option('doc', type: 'boolean', value: false, description: 'Whether to generate valadoc') +option('demo', type: 'boolean', value: false, description: 'Whether to build demo app')