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.
22 lines
401 B
Bash
Executable File
22 lines
401 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Check if the build directory is present, and remove it
|
|
if [ -d "build" ]; then
|
|
rm -rf build
|
|
fi
|
|
|
|
# Check for the --noTest flag
|
|
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
|