loplugin:constmethod in editeng
[LibreOffice.git] / bin / gen-boost-headers
blob478e9c8f7ee0b718c1a1f5a97cbd537054a5a09b
1 #!/bin/bash
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 # generate a bunch of dummy headers that wrap the crappy boost headers and
11 # suppress a myriad of warnings; requires GCC's #include_next extension
13 set -euo pipefail
14 IFS=$'\n\t'
16 GENDIR=${SRCDIR}/external/boost/include
18 rm -rf ${GENDIR}
19 mkdir ${GENDIR}
21 # note: clucene contains a copy of half of boost, so ignore it too
22 # note: firebird contains a copy of half of boost, so ignore it too
24 cat <(cd ${SRCDIR} && git grep -h '^# *include') \
25 <(find ${WORKDIR}/UnpackedTarball/ -mindepth 1 -maxdepth 1 -type d \
26 | grep -v boost \
27 | grep -v clucene \
28 | grep -v firebird \
29 | xargs grep -hr '^# *include') \
30 | grep -o '\bboost.*\.\(h\|hpp\|ipp\)' \
31 | sort | uniq \
32 | while read -r HEADER; do
33 mkdir -p "$(dirname ${GENDIR}/${HEADER})"
34 cat > "${GENDIR}/${HEADER}" << _EOF
35 /* generated by $0, do not edit! */
36 #pragma once
37 #pragma GCC diagnostic push
38 #pragma GCC diagnostic ignored "-Wpragmas" /* first! for GCC */
39 #pragma GCC diagnostic ignored "-Wunknown-warning-option" // second! for Clang 5
40 #pragma GCC diagnostic ignored "-Wdelete-non-virtual-dtor"
41 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
42 #pragma GCC diagnostic ignored "-Wdeprecated-copy"
43 #pragma GCC diagnostic ignored "-Wextra"
44 #pragma GCC diagnostic ignored "-Wignored-qualifiers"
45 #pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
46 #pragma GCC diagnostic ignored "-Winvalid-constexpr"
47 #pragma GCC diagnostic ignored "-Wmicrosoft-unqualified-friend"
48 #pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
49 #pragma GCC diagnostic ignored "-Wparentheses"
50 #pragma GCC diagnostic ignored "-Wplacement-new"
51 #pragma GCC diagnostic ignored "-Wreturn-type"
52 #pragma GCC diagnostic ignored "-Wshadow"
53 #pragma GCC diagnostic ignored "-Wstrict-aliasing"
54 #pragma GCC diagnostic ignored "-Wtautological-constant-out-of-range-compare"
55 #pragma GCC diagnostic ignored "-Wtype-limits"
56 #pragma GCC diagnostic ignored "-Wundef"
57 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
58 #pragma GCC diagnostic ignored "-Wunused-macros"
59 #pragma GCC diagnostic ignored "-Wunused-parameter"
60 #pragma GCC diagnostic ignored "-Wunused-variable"
61 #include_next <${HEADER}>
62 #pragma GCC diagnostic pop
63 _EOF
64 done