a2f07abd89fd7300a05c42860b856aea72be9687 — Simon Ser 4 months ago 228bfc7
Move highlight example to new subdir, add a Meson option for it
4 files changed, 15 insertions(+), 8 deletions(-)

R highlight.c => example/highlight.c
A example/meson.build
M meson.build
M meson_options.txt
R highlight.c => example/highlight.c +0 -0

A example/meson.build => example/meson.build +6 -0
@@ 0,0 1,6 @@
+executable(
+	'highlight',
+	files('highlight.c'),
+	dependencies: [mrsh],
+	build_by_default: get_option('examples'),
+)

M meson.build => meson.build +2 -8
@@ 147,14 147,7 @@ mrsh_exe = executable(
 	install: true,
 )
 
-executable(
-	'highlight',
-	files([
-		'highlight.c',
-	]),
-	dependencies: [mrsh],
-)
-
+subdir('example')
 subdir('test')
 
 pkgconfig = import('pkgconfig')


@@ 170,5 163,6 @@ status = [
 	'',
 	'Features:',
 	'  readline: @0@'.format(readline.found()),
+	'  examples: @0@'.format(get_option('examples')),
 ]
 message('\n'.join(status))

M meson_options.txt => meson_options.txt +7 -0
@@ 12,3 12,10 @@ option(
 	value: 'readline',
 	description: 'Provider of the readline library',
 )
+
+option(
+	'examples',
+	type: 'boolean',
+	value: true,
+	description: 'Build example programs',
+)