@@ -11,6 +11,8 @@ CPPFLAGS+=("-Iother/bootstrap_daemon/src")
1111CPPFLAGS+=(" -Iother/fun" )
1212CPPFLAGS+=(" -Itesting" )
1313CPPFLAGS+=(" -Itesting/fuzzing" )
14+ CPPFLAGS+=(" -Itesting/support/doubles" )
15+ CPPFLAGS+=(" -Itesting/support/public" )
1416CPPFLAGS+=(" -Itoxcore" )
1517CPPFLAGS+=(" -Itoxcore/events" )
1618CPPFLAGS+=(" -Itoxav" )
@@ -51,33 +53,44 @@ callmain() {
5153
5254# Include all C and C++ code
5355FIND_QUERY=" find . '-(' -name '*.c' -or -name '*.cc' '-)'"
54- # Excludes
55- FIND_QUERY=" $FIND_QUERY -and -not -wholename './_build/*'"
56- FIND_QUERY=" $FIND_QUERY -and -not -wholename './other/docker/*'"
57- FIND_QUERY=" $FIND_QUERY -and -not -wholename './super_donators/*'"
58- FIND_QUERY=" $FIND_QUERY -and -not -name amalgamation.cc"
59- FIND_QUERY=" $FIND_QUERY -and -not -name av_test.c"
60- FIND_QUERY=" $FIND_QUERY -and -not -name cracker.c"
61- FIND_QUERY=" $FIND_QUERY -and -not -name version_test.c"
62- FIND_QUERY=" $FIND_QUERY -and -not -name '*_fuzz_test.cc'"
63- FIND_QUERY=" $FIND_QUERY -and -not -wholename './testing/fuzzing/*'"
64- FIND_QUERY=" $FIND_QUERY -and -not -wholename './third_party/cmp/examples/*'"
65- FIND_QUERY=" $FIND_QUERY -and -not -wholename './third_party/cmp/test/*'"
56+ HEADER_QUERY=" find . '-(' -name '*.h' -or -name '*.hh' '-)'"
57+
58+ COMMON_EXCLUDES=" "
59+ COMMON_EXCLUDES=" $COMMON_EXCLUDES -and -not -wholename './_build/*'"
60+ COMMON_EXCLUDES=" $COMMON_EXCLUDES -and -not -wholename './other/docker/*'"
61+ COMMON_EXCLUDES=" $COMMON_EXCLUDES -and -not -wholename './super_donators/*'"
62+ COMMON_EXCLUDES=" $COMMON_EXCLUDES -and -not -wholename './testing/fuzzing/*'"
63+ COMMON_EXCLUDES=" $COMMON_EXCLUDES -and -not -wholename './third_party/cmp/examples/*'"
64+ COMMON_EXCLUDES=" $COMMON_EXCLUDES -and -not -wholename './third_party/cmp/test/*'"
65+
66+ # File name excludes
67+ COMMON_EXCLUDES=" $COMMON_EXCLUDES -and -not -name amalgamation.cc"
68+ COMMON_EXCLUDES=" $COMMON_EXCLUDES -and -not -name av_test.c"
69+ COMMON_EXCLUDES=" $COMMON_EXCLUDES -and -not -name cracker.c"
70+ COMMON_EXCLUDES=" $COMMON_EXCLUDES -and -not -name version_test.c"
71+ COMMON_EXCLUDES=" $COMMON_EXCLUDES -and -not -name '*_fuzz_test.cc'"
6672
6773if [ " $SKIP_BENCHMARK " == 1 ]; then
68- FIND_QUERY =" $FIND_QUERY -and -not -name '*_bench.cc'"
74+ COMMON_EXCLUDES =" $COMMON_EXCLUDES -and -not -name '*_bench.cc'"
6975fi
7076
7177if [ " $SKIP_GTEST " == 1 ]; then
72- FIND_QUERY =" $FIND_QUERY -and -not -name '*_test.cc'"
78+ COMMON_EXCLUDES =" $COMMON_EXCLUDES -and -not -name '*_test.cc'"
7379fi
7480
81+ FIND_QUERY=" $FIND_QUERY $COMMON_EXCLUDES "
82+ HEADER_QUERY=" $HEADER_QUERY $COMMON_EXCLUDES "
83+
7584readarray -t FILES <<< " $(eval " $FIND_QUERY " )"
85+ readarray -t HEADERS <<< " $(eval " $HEADER_QUERY " )"
7686
77- (for i in " ${FILES[@]} " ; do
87+ INCLUDES= $ ( for i in " ${FILES[@]} " " ${HEADERS [@]}" ; do
7888 grep -o ' #include <[^>]*>' " $i " |
7989 grep -E -v ' <win|<ws|<iphlp|<libc|<mach/|<crypto_|<randombytes|<u.h>|<sys/filio|<stropts.h>|<linux'
80- done) | sort -u >> amalgamation.cc
90+ done | sort -u)
91+
92+ echo " $INCLUDES " | grep " <memory>" >> amalgamation.cc
93+ echo " $INCLUDES " | grep -v " <memory>" >> amalgamation.cc
8194
8295put auto_tests/check_compat.h
8396
0 commit comments