diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..b9f2fff --- /dev/null +++ b/meson_options.txt @@ -0,0 +1 @@ +option('build_tests', type: 'boolean', value: true, description: 'Build tests') \ No newline at end of file diff --git a/mk b/mk index d9ba04d..4179b41 100755 --- a/mk +++ b/mk @@ -1,9 +1,21 @@ #!/bin/bash -# if build directory is present, remove it +# Check if the build directory is present, and remove it if [ -d "build" ]; then rm -rf build fi -meson setup build -meson compile -C build \ No newline at end of file +# 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