ClickHouse/utils/check_include.sh

56 lines
1.8 KiB
Bash
Raw Normal View History

#!/bin/sh
# sudo apt install time
# Small .h isolated compile checker
# Finds missing #include <...>
# prints compile time, number of includes, use with sort: ./check_include.sh 2>&1 | sort -rk3
2018-06-06 18:41:39 +00:00
# use with clang: CXX=`which clang++-7 clang++-7.0 clang++-6.0 clang++-5.0 | head -n1` ./check_include.sh
pwd=`pwd`
BUILD_DIR=${BUILD_DIR:=./build}
2017-06-20 11:32:45 +00:00
inc="-I. \
-I./contrib/libdivide \
-I./contrib/re2 \
-I${BUILD_DIR}/contrib/re2_st \
2017-06-20 11:32:45 +00:00
-I./contrib/libfarmhash \
-I./contrib/libmetrohash/src \
2018-01-16 17:25:25 +00:00
-I./contrib/double-conversion \
-I./contrib/cityhash102/include \
2018-08-21 17:25:00 +00:00
-I./contrib/murmurhash/include \
2017-10-26 11:46:57 +00:00
-I./contrib/zookeeper/src/c/include \
-I./contrib/zookeeper/src/c/generated \
2017-06-20 11:32:45 +00:00
-I./contrib/libtcmalloc/include \
-I${BUILD_DIR}/contrib/zlib-ng \
2017-11-22 19:15:17 +00:00
-I./contrib/zlib-ng \
2017-10-26 11:46:57 +00:00
-I./contrib/poco/MongoDB/include \
-I./contrib/poco/XML/include \
-I./contrib/poco/Crypto/include \
-I./contrib/poco/Data/ODBC/include \
-I./contrib/poco/Data/include \
-I./contrib/poco/Net/include \
-I./contrib/poco/Util/include \
-I./contrib/poco/Foundation/include \
-I./contrib/boost/libs/*/include \
-I./contrib/boost \
2018-06-06 18:41:39 +00:00
-I./contrib/llvm/llvm/include \
-I${BUILD_DIR}/contrib/llvm/llvm/include \
2017-06-20 11:32:45 +00:00
-I./contrib/libbtrie/include \
2017-09-18 18:52:12 +00:00
-I./contrib/libpcg-random/include \
2018-08-28 19:36:27 +00:00
-I./contrib/capnproto/c++/src \
2017-06-20 11:32:45 +00:00
-I./libs/libmysqlxx/include \
-I./libs/libcommon/include \
-I${BUILD_DIR}/libs/libcommon/include \
2017-06-20 11:32:45 +00:00
-I./libs/libpocoext/include \
-I./libs/libzkutil/include \
-I./libs/libdaemon/include \
2018-04-02 12:31:04 +00:00
-I./libs/libconsistent-hashing \
2017-06-20 11:32:45 +00:00
-I./dbms/src \
-I${BUILD_DIR}/dbms/src"
2017-06-20 11:32:45 +00:00
if [ -z $1 ]; then
cd ..
2017-07-24 12:58:01 +00:00
find dbms libs utils \( -name *.h -and -not -name *.inl.h \) -exec sh $pwd/$0 {} \; ;
else
echo -n "$1 "
echo -n `grep "#include" $1| wc -l` " "
2018-08-21 17:25:00 +00:00
echo "#include <$1> \n int main() {return 0;}" | time --format "%e %M" ${CXX:=g++-7} -c -std=c++1z $inc -x c++ -
fi