Skip to content

Commit

Permalink
feat: install examples for top level builds
Browse files Browse the repository at this point in the history
This might be useful for distribution packagers to provide example programs in their packages.

Signed-off-by: Sefa Eyeoglu <[email protected]>
  • Loading branch information
Scrumplex committed Sep 1, 2024
1 parent e2bae9d commit 8a135bf
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ UTF-8 decoding is performed using a state machine based on Bjoern Hoehrmann's '[
- **[@rbrugo](https://github.com/rbrugo)** - Helped design a new feature
- **[@Reedbeta](https://github.com/Reedbeta)** - Fixed a bug and added additional Visual Studio debugger native visualizers
- **[@Ryan-rsm-McKenzie](https://github.com/Ryan-rsm-McKenzie)** - Add natvis file to cmake install script
- **[@Scrumplex][https://github.com/Scrumplex)** - Tweaked the build scripts
- **[@shdnx](https://github.com/shdnx)** - Fixed a bug on GCC 8.2.0 and some meson config issues
- **[@sneves](https://github.com/sneves)** - Helped fix a number of parser bugs
- **[@sobczyk](https://github.com/sobczyk)** - Reported some bugs
Expand Down
3 changes: 2 additions & 1 deletion examples/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ foreach example : examples
[ example + '.cpp' ],
cpp_args: example_args,
dependencies: tomlplusplus_dep,
override_options: global_overrides
override_options: global_overrides,
install: install_examples
)
]]
endforeach
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ unreleased_features = get_option('unreleased_features')

build_tests = (get_option('build_tests') or is_devel) and not is_subproject
build_examples = (get_option('build_examples') or is_devel) and not is_subproject
install_examples = (get_option('install_examples')) and build_tests
build_tt = (get_option('build_tt') or is_devel) and not is_subproject and has_exceptions and not unreleased_features
build_lib = get_option('build_lib') or get_option('compile_library') or build_tests or build_examples or build_tt

Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
option('devel', type: 'boolean', value: false, description: 'Tell meson whether or not it is a development build. (default: false)')
option('build_lib', type: 'boolean', value: false, description: 'Compile the library, rather than consuming it in header-only mode. (default: false) (implied by devel)')
option('build_examples', type: 'boolean', value: false, description: 'Build the examples (default: false) (implied by devel)')
option('install_examples', type: 'boolean', value: false, description: 'Install the examples (default: false)')
option('build_tests', type: 'boolean', value: false, description: 'Build tests (default: false) (implied by devel)')
option('build_tt', type: 'boolean', value: false, description: 'Enable to build the toml-test encoder and decoder. (default: false) (implied by devel) (disabled by unreleased_features)')
option('pedantic', type: 'boolean', value: false, description: 'Enable as many compiler warnings as possible (default: false) (implied by devel)')
Expand Down

0 comments on commit 8a135bf

Please sign in to comment.