aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2020-01-16 21:28:24 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2020-01-16 21:28:24 +0100
commitce93b3a1a9d383f07832be5edb8cf1300abe1db0 (patch)
treeb116deb7c3b26707f3f7dc5549c57fbf72d8b229
parent104ed6b0612b6872c5b0590967c772845f1eb697 (diff)
downloadd2tk-ce93b3a1a9d383f07832be5edb8cf1300abe1db0.tar.xz
meson: add build-{examples,tests} build time flags.
-rw-r--r--VERSION2
-rw-r--r--meson.build96
-rw-r--r--meson_options.txt2
3 files changed, 57 insertions, 43 deletions
diff --git a/VERSION b/VERSION
index 89a0e98..a1f0c8a 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.967
+0.1.969
diff --git a/meson.build b/meson.build
index 63231ee..9ca2654 100644
--- a/meson.build
+++ b/meson.build
@@ -7,6 +7,8 @@ project('d2tk', 'c', default_options : [
static_link = false #meson.is_cross_build()
build_debug = get_option('build-debug')
+build_examples = get_option('build-examples')
+build_tests = get_option('build-tests')
prefix = get_option('prefix')
datadir = get_option('datadir')
@@ -198,11 +200,13 @@ if freetype_dep.found() and pixman_dep.found() and cairo_dep.found() and cairo_x
link_args : links,
sources : [lib_srcs, cairo_srcs, pugl_srcs, pugl_cairo_srcs])
- executable('d2tk.cairo', [bin_srcs, pugl_bin_srcs],
- c_args : c_args,
- include_directories : inc_dir,
- dependencies: d2tk_cairo,
- install : false)
+ if build_examples
+ executable('d2tk.cairo', [bin_srcs, pugl_bin_srcs],
+ c_args : c_args,
+ include_directories : inc_dir,
+ dependencies: d2tk_cairo,
+ install : false)
+ endif
if input_dep.found() and udev_dep.found() and evdev_dep.found()
d2tk_fbdev = declare_dependency(
@@ -211,11 +215,13 @@ if freetype_dep.found() and pixman_dep.found() and cairo_dep.found() and cairo_x
link_args : links,
sources : [lib_srcs, cairo_srcs, fbdev_srcs])
- executable('d2tk.fbdev', [bin_srcs, fbdev_bin_srcs],
- c_args : c_args,
- include_directories : inc_dir,
- dependencies: d2tk_fbdev,
- install : false)
+ if build_examples
+ executable('d2tk.fbdev', [bin_srcs, fbdev_bin_srcs],
+ c_args : c_args,
+ include_directories : inc_dir,
+ dependencies: d2tk_fbdev,
+ install : false)
+ endif
endif
endif
@@ -225,11 +231,13 @@ d2tk_nanovg = declare_dependency(
link_args : links,
sources : [lib_srcs, nanovg_srcs, pugl_srcs, pugl_gl_srcs])
-executable('d2tk.nanovg', [bin_srcs, pugl_bin_srcs],
- c_args : c_args,
- include_directories : inc_dir,
- dependencies: d2tk_nanovg,
- install : false)
+if build_examples
+ executable('d2tk.nanovg', [bin_srcs, pugl_bin_srcs],
+ c_args : c_args,
+ include_directories : inc_dir,
+ dependencies: d2tk_nanovg,
+ install : false)
+endif
configure_file(
input : join_paths('d2tk', 'config.h.in'),
@@ -269,35 +277,39 @@ if not fontconfig_dep.found()
install : false)
endif
-configure_file(
- input : join_paths('example', 'libre-arrow-circle-right.png'),
- output : 'libre-arrow-circle-right.png',
- copy : true,
- install : false)
+if build_examples
+ configure_file(
+ input : join_paths('example', 'libre-arrow-circle-right.png'),
+ output : 'libre-arrow-circle-right.png',
+ copy : true,
+ install : false)
-configure_file(
- input : join_paths('example', 'libre-gui-folder.png'),
- output : 'libre-gui-folder.png',
- copy : true,
- install : false)
+ configure_file(
+ input : join_paths('example', 'libre-gui-folder.png'),
+ output : 'libre-gui-folder.png',
+ copy : true,
+ install : false)
-configure_file(
- input : join_paths('example', 'libre-gui-file.png'),
- output : 'libre-gui-file.png',
- copy : true,
- install : false)
+ configure_file(
+ input : join_paths('example', 'libre-gui-file.png'),
+ output : 'libre-gui-file.png',
+ copy : true,
+ install : false)
+endif
-test_core = executable('test.core', [test_core_srcs, lib_srcs],
- c_args : c_args,
- dependencies : deps,
- include_directories : inc_dir,
- install : false)
+if build_tests
+ test_core = executable('test.core', [test_core_srcs, lib_srcs],
+ c_args : c_args,
+ dependencies : deps,
+ include_directories : inc_dir,
+ install : false)
-test_base = executable('test.base', [test_base_srcs, lib_srcs],
- c_args : c_args,
- dependencies : deps,
- include_directories : inc_dir,
- install : false)
+ test_base = executable('test.base', [test_base_srcs, lib_srcs],
+ c_args : c_args,
+ dependencies : deps,
+ include_directories : inc_dir,
+ install : false)
-test('Test core', test_core)
-test('Test base', test_base)
+ test('Test core', test_core)
+ test('Test base', test_base)
+endif
diff --git a/meson_options.txt b/meson_options.txt
index a658483..253789f 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1 +1,3 @@
option('build-debug', type : 'boolean', value : false)
+option('build-examples', type : 'boolean', value : false)
+option('build-tests', type : 'boolean', value : true)