2017-02-02 22:08:43 +00:00
|
|
|
#!/bin/sh
|
2018-08-29 19:43:58 +00:00
|
|
|
set -e
|
|
|
|
#set -x
|
2017-07-27 19:05:55 +00:00
|
|
|
# sudo apt install time
|
2017-02-02 22:08:43 +00:00
|
|
|
# Small .h isolated compile checker
|
|
|
|
# Finds missing #include <...>
|
2017-02-07 15:38:57 +00:00
|
|
|
# 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
|
2018-11-10 20:09:07 +00:00
|
|
|
CUR_DIR=`dirname $0`
|
|
|
|
CUR_DIR=`readlink -f $CUR_DIR`
|
|
|
|
CUR_DIR="${CUR_DIR}/"
|
2018-02-14 17:27:14 +00:00
|
|
|
BUILD_DIR=${BUILD_DIR:=./build}
|
2017-06-20 11:32:45 +00:00
|
|
|
inc="-I. \
|
|
|
|
-I./contrib/libdivide \
|
2018-02-14 17:27:14 +00:00
|
|
|
-I./contrib/re2 \
|
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 \
|
2018-06-19 18:09:09 +00:00
|
|
|
-I./contrib/cityhash102/include \
|
2019-03-13 13:58:04 +00:00
|
|
|
-I./contrib/croaring \
|
2020-11-09 22:32:50 +00:00
|
|
|
-I./contrib/miniselect/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 \
|
2018-02-14 17:27:14 +00:00
|
|
|
-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 \
|
2018-03-02 20:01:54 +00:00
|
|
|
-I./contrib/boost/libs/*/include \
|
|
|
|
-I./contrib/boost \
|
2018-12-19 17:57:51 +00:00
|
|
|
-I/usr/include/llvm-7 \
|
|
|
|
-I/usr/include/llvm-6.0 \
|
|
|
|
-I/usr/include/llvm-5.0 \
|
2018-06-06 18:41:39 +00:00
|
|
|
-I./contrib/llvm/llvm/include \
|
|
|
|
-I${BUILD_DIR}/contrib/llvm/llvm/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 \
|
2018-11-10 20:09:07 +00:00
|
|
|
-I./contrib/unixodbc/include \
|
|
|
|
-I./contrib/unixodbc-cmake/linux_x86_64 \
|
2020-02-17 16:30:25 +00:00
|
|
|
-I./base/mysqlxx \
|
|
|
|
-I./base \
|
|
|
|
-I${BUILD_DIR}/base \
|
|
|
|
-I./base/daemon \
|
|
|
|
-I./base/consistent-hashing \
|
2018-12-27 15:23:37 +00:00
|
|
|
-I./contrib/libhdfs3/include \
|
2023-08-31 12:28:39 +00:00
|
|
|
-I./contrib/aklomp-base64/include \
|
2019-03-13 13:58:04 +00:00
|
|
|
-I./contrib/protobuf/src \
|
|
|
|
-I./contrib/cppkafka/include \
|
|
|
|
-I./contrib/librdkafka-cmake/include \
|
2018-12-27 15:23:37 +00:00
|
|
|
-I./contrib/lz4/lib \
|
2019-05-14 09:58:33 +00:00
|
|
|
-I./contrib/hyperscan/src \
|
|
|
|
-I./contrib/simdjson/include \
|
2020-05-27 19:11:04 +00:00
|
|
|
-I./contrib/sentry-native/include \
|
2020-04-14 07:13:37 +00:00
|
|
|
-I./src \
|
|
|
|
-I${BUILD_DIR}/src"
|
2017-06-20 11:32:45 +00:00
|
|
|
|
2017-02-02 22:08:43 +00:00
|
|
|
if [ -z $1 ]; then
|
2018-11-10 20:09:07 +00:00
|
|
|
cd ${ROOT_DIR=${CUR_DIR}../..}
|
2020-02-17 16:30:25 +00:00
|
|
|
find base dbms utils \( -name *.h -and -not -name *.inl.h \) -print0 | xargs -0 -n1 sh $CUR_DIR`basename $0`
|
2017-02-02 22:08:43 +00:00
|
|
|
else
|
2017-04-05 11:52:23 +00:00
|
|
|
echo -n "$1 "
|
|
|
|
echo -n `grep "#include" $1| wc -l` " "
|
2019-03-13 13:58:04 +00:00
|
|
|
echo "#include <$1>\nint main() {return 0;}" | time --format "%e %M" ${CXX:=g++-7} -c -std=c++1z $inc -x c++ -
|
2017-02-02 22:08:43 +00:00
|
|
|
fi
|