2017-02-02 22:08:43 +00:00
|
|
|
#!/bin/sh
|
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
|
2017-02-02 22:08:43 +00:00
|
|
|
pwd=`pwd`
|
2017-06-20 11:32:45 +00:00
|
|
|
inc="-I. \
|
|
|
|
-I./contrib/libdivide \
|
|
|
|
-I./contrib/libre2 \
|
|
|
|
-I./build/contrib/libre2 \
|
|
|
|
-I./contrib/libfarmhash \
|
|
|
|
-I./contrib/libmetrohash/src \
|
|
|
|
-I./contrib/libdouble-conversion \
|
|
|
|
-I./contrib/libcityhash/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/contrib/libzlib-ng \
|
|
|
|
-I./contrib/libzlib-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 \
|
2017-06-20 11:32:45 +00:00
|
|
|
-I./contrib/libboost/boost_1_62_0 \
|
|
|
|
-I./contrib/libbtrie/include \
|
2017-09-18 18:52:12 +00:00
|
|
|
-I./contrib/libpcg-random/include \
|
2017-06-20 11:32:45 +00:00
|
|
|
-I./libs/libmysqlxx/include \
|
|
|
|
-I./libs/libcommon/include \
|
|
|
|
-I./build/libs/libcommon/include \
|
|
|
|
-I./libs/libpocoext/include \
|
|
|
|
-I./libs/libzkutil/include \
|
|
|
|
-I./libs/libdaemon/include \
|
|
|
|
-I./dbms/src \
|
|
|
|
-I./build/dbms/src"
|
|
|
|
|
2017-02-02 22:08:43 +00:00
|
|
|
if [ -z $1 ]; then
|
2017-04-05 11:52:23 +00:00
|
|
|
cd ..
|
2017-07-24 12:58:01 +00:00
|
|
|
find dbms libs utils \( -name *.h -and -not -name *.inl.h \) -exec sh $pwd/$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` " "
|
2017-09-18 18:52:12 +00:00
|
|
|
echo -e "#include <$1> \n int main() {return 0;}" | time --format "%e %M" g++-7 -c -std=gnu++1z $inc -x c++ -
|
2017-02-02 22:08:43 +00:00
|
|
|
fi
|