example for using clang and ninja

This commit is contained in:
ttroy50
2016-02-14 11:24:59 +00:00
parent 9c07934ba7
commit 5ad50c1ffa
10 changed files with 356 additions and 5 deletions

19
test.sh
View File

@@ -8,6 +8,8 @@ dirs=( ./01-basic/A-hello-cmake \
./01-basic/F-build-type \
./01-basic/G-compile-flags \
./01-basic/H-third-party-library \
./01-basic/I-compiling-with-clang \
./01-basic/J-building-with-ninja \
./02-sub-projects/A-basic \
./03-code-generation/protobuf \
./03-code-generation/configure-files \
@@ -38,10 +40,19 @@ do
fi
fi
cd $dir && mkdir -p build && cd build && cmake .. && make
if [ $? -ne 0 ]; then
echo "Error running example $dir"
exit 1
if [ -f "$dir/run_test.sh" ]; then
echo "running run_test"
$ROOT_DIR/$dir/run_test.sh
if [ $? -ne 0 ]; then
echo "Error running run_test for $dir"
exit 1
fi
else
cd $dir && mkdir -p build && cd build && cmake .. && make
if [ $? -ne 0 ]; then
echo "Error running example $dir"
exit 1
fi
fi
if [ -f "$ROOT_DIR/$dir/post_test.sh" ]; then