feat: optimize out in Release builds

- fix: fastest scope matching,
- feat: try to allow the compiler to optimize out as many conditional statements as possible,
        which allow to use clutchlog for progress-only messages in Release mode.
- feat: build_all.sh test script,
- fix: typo in macro declarations in builds without clutchlog,
- update the README accordingly.
This commit is contained in:
Johann Dreo 2020-09-15 23:07:42 +02:00
commit 243b22e4c1
6 changed files with 239 additions and 29 deletions

25
build_all.sh Executable file
View file

@ -0,0 +1,25 @@
#!/bin/bash
build()
{
build_dir="$1_$2"
mkdir -p $build_dir
cd $build_dir
echo -ne "Build type: $1,\twith clutchlog: $2...\t"
(cmake -DCMAKE_BUILD_TYPE=$1 -DWITH_CLUTCHLOG=$2 .. && make && ctest) 2>&1 >> ../build_all.log
if [[ $? == 0 ]]; then
echo "OK"
else
echo "ERROR"
fi
cd ..
}
rm -f build_all.log
for t in "Debug" "Release" "RelWithDebInfo"; do
for w in "ON" "OFF"; do
build $t $w
done
done