Skip to content

Commit 8a135bf

Browse files
committed
feat: install examples for top level builds
This might be useful for distribution packagers to provide example programs in their packages. Signed-off-by: Sefa Eyeoglu <[email protected]>
1 parent e2bae9d commit 8a135bf

File tree

4 files changed

+5
-1
lines changed

4 files changed

+5
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ UTF-8 decoding is performed using a state machine based on Bjoern Hoehrmann's '[
294294
- **[@rbrugo](https://github.com/rbrugo)** - Helped design a new feature
295295
- **[@Reedbeta](https://github.com/Reedbeta)** - Fixed a bug and added additional Visual Studio debugger native visualizers
296296
- **[@Ryan-rsm-McKenzie](https://github.com/Ryan-rsm-McKenzie)** - Add natvis file to cmake install script
297+
- **[@Scrumplex][https://github.com/Scrumplex)** - Tweaked the build scripts
297298
- **[@shdnx](https://github.com/shdnx)** - Fixed a bug on GCC 8.2.0 and some meson config issues
298299
- **[@sneves](https://github.com/sneves)** - Helped fix a number of parser bugs
299300
- **[@sobczyk](https://github.com/sobczyk)** - Reported some bugs

examples/meson.build

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ foreach example : examples
2424
[ example + '.cpp' ],
2525
cpp_args: example_args,
2626
dependencies: tomlplusplus_dep,
27-
override_options: global_overrides
27+
override_options: global_overrides,
28+
install: install_examples
2829
)
2930
]]
3031
endforeach

meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ unreleased_features = get_option('unreleased_features')
5252

5353
build_tests = (get_option('build_tests') or is_devel) and not is_subproject
5454
build_examples = (get_option('build_examples') or is_devel) and not is_subproject
55+
install_examples = (get_option('install_examples')) and build_tests
5556
build_tt = (get_option('build_tt') or is_devel) and not is_subproject and has_exceptions and not unreleased_features
5657
build_lib = get_option('build_lib') or get_option('compile_library') or build_tests or build_examples or build_tt
5758

meson_options.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
option('devel', type: 'boolean', value: false, description: 'Tell meson whether or not it is a development build. (default: false)')
22
option('build_lib', type: 'boolean', value: false, description: 'Compile the library, rather than consuming it in header-only mode. (default: false) (implied by devel)')
33
option('build_examples', type: 'boolean', value: false, description: 'Build the examples (default: false) (implied by devel)')
4+
option('install_examples', type: 'boolean', value: false, description: 'Install the examples (default: false)')
45
option('build_tests', type: 'boolean', value: false, description: 'Build tests (default: false) (implied by devel)')
56
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)')
67
option('pedantic', type: 'boolean', value: false, description: 'Enable as many compiler warnings as possible (default: false) (implied by devel)')

0 commit comments

Comments
 (0)