From 92b75a134582b3f54b1c8b4099616e67101d77be Mon Sep 17 00:00:00 2001 From: Randy Date: Wed, 5 Aug 2020 22:49:52 +0200 Subject: [PATCH] meson: add option to build tests, default to false --- meson.build | 19 +++++++++++-------- meson_options.txt | 1 + 2 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 meson_options.txt diff --git a/meson.build b/meson.build index 059dff8..20d7852 100644 --- a/meson.build +++ b/meson.build @@ -83,16 +83,17 @@ pkg.generate( description : 'OpenGL Mathematics (glm) for C' ) +if get_option('build_tests') == true test_src = files( - 'test/runner.c', - 'test/src/test_euler.c', - 'test/src/test_bezier.c', - 'test/src/test_cam.c', - 'test/src/test_struct.c', - 'test/src/test_clamp.c', - 'test/src/test_common.c', - 'test/src/tests.c' + 'test/runner.c', + 'test/src/test_euler.c', + 'test/src/test_bezier.c', + 'test/src/test_cam.c', + 'test/src/test_struct.c', + 'test/src/test_clamp.c', + 'test/src/test_common.c', + 'test/src/tests.c' ) test_exe = executable('tests', @@ -102,3 +103,5 @@ test_exe = executable('tests', ) test('cglm.tests', test_exe) + +endif \ No newline at end of file diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..ca48e5e --- /dev/null +++ b/meson_options.txt @@ -0,0 +1 @@ +option('build_tests', type : 'boolean', value : false, description : 'Build tests') \ No newline at end of file