File indexing completed on 2024-10-06 12:12:53
0001 #!/bin/bash 0002 0003 BUILDDIR=build-clang 0004 0005 if [ ! -d $BUILDDIR ]; then 0006 mkdir -p $BUILDDIR 0007 fi 0008 0009 cd $BUILDDIR 0010 0011 export CC=clang 0012 export CXX=clang++ 0013 0014 cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr && make -j 4 0015 # debug 0016 # -ftime-trace for clang >= 9 0017 #cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-D_GNU_SOURCE -O2 -Wall -Wextra -Wundef -Wpointer-arith -Wcast-align -Wunreachable-code -fno-omit-frame-pointer -fstack-protector -fno-exceptions -fsanitize=address -fsanitize=undefined -fPIE" -DCMAKE_CXX_FLAGS="-D_GNU_SOURCE -std=c++11 -O2 -Wall -Wextra -Wundef -Wpointer-arith -Wcast-align -Wunreachable-code -fno-omit-frame-pointer -fstack-protector -fno-exceptions -fsanitize=address -fsanitize=undefined -fPIE" -DCMAKE_INSTALL_PREFIX=/usr && make -j 4 0018 # tidy 0019 #cmake .. -DCMAKE_BUILD_TYPE=Release -DENABLE_CLANG_TIDY=on -DCMAKE_INSTALL_PREFIX=/usr && make