build(meson): added command line options to not build tests
meson_options added which includes a build test variable. If this is false (default: true) tests will be build. the mk script can controll this with the --noTest command line argument.
This commit is contained in:
1
meson_options.txt
Normal file
1
meson_options.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
option('build_tests', type: 'boolean', value: true, description: 'Build tests')
|
||||||
18
mk
18
mk
@@ -1,9 +1,21 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# if build directory is present, remove it
|
# Check if the build directory is present, and remove it
|
||||||
if [ -d "build" ]; then
|
if [ -d "build" ]; then
|
||||||
rm -rf build
|
rm -rf build
|
||||||
fi
|
fi
|
||||||
|
|
||||||
meson setup build
|
# Check for the --noTest flag
|
||||||
meson compile -C build
|
if [[ "$1" == "--noTest" ]]; then
|
||||||
|
meson setup build -Dbuild_tests=false
|
||||||
|
else
|
||||||
|
meson setup build -Dbuild_tests=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Compile the project
|
||||||
|
meson compile -C build
|
||||||
|
|
||||||
|
# If tests are built, run them
|
||||||
|
if [[ "$1" != "--noTest" ]]; then
|
||||||
|
meson test -C build
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user