File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,11 @@ export PATH="/usr/lib/ccache/bin:/usr/lib/ccache:/usr/lib64/ccache:$PATH"
5
5
export CCACHE_DIR=/icinga2/ccache
6
6
export CTEST_OUTPUT_ON_FAILURE=1
7
7
CMAKE_OPTS=()
8
+ # -Wstringop-overflow is notorious for false positives and has been a problem for years.
9
+ # See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88443
10
+ # -Wtemplate-id-cdtor leaks from using the generated headers. We should reenable this once
11
+ # we're considering moving to C++20 and/or the -ti.hpp files are generated differently.
12
+ WARN_FLAGS=" -Wall -Wextra -Wno-template-id-cdtor -Wno-stringop-overflow"
8
13
9
14
case " $DISTRO " in
10
15
alpine:* )
79
84
80
85
case " $DISTRO " in
81
86
alpine:* )
82
- CMAKE_OPTS+=(-DUSE_SYSTEMD=OFF -DICINGA2_WITH_MYSQL=OFF -DICINGA2_WITH_PGSQL=OFF)
87
+ CMAKE_OPTS+=(
88
+ -DUSE_SYSTEMD=OFF
89
+ -DICINGA2_WITH_MYSQL=OFF
90
+ -DICINGA2_WITH_PGSQL=OFF
91
+ -DCMAKE_{C,CXX}_FLAGS=" ${WARN_FLAGS} "
92
+ )
83
93
;;
84
94
debian:* |ubuntu:* )
85
95
CMAKE_OPTS+=(-DICINGA2_LTO_BUILD=ON)
86
96
source <( dpkg-buildflags --export=sh)
97
+ export CFLAGS=" ${CFLAGS} ${WARN_FLAGS} "
98
+ export CXXFLAGS=" ${CXXFLAGS} ${WARN_FLAGS} "
87
99
;;
88
100
* )
89
- CMAKE_OPTS+=(-DCMAKE_{C,CXX}_FLAGS=" $( rpm -E ' %{optflags} %{?march_flag}' ) " )
101
+ CMAKE_OPTS+=(-DCMAKE_{C,CXX}_FLAGS=" $( rpm -E ' %{optflags} %{?march_flag}' ) ${WARN_FLAGS} " )
90
102
export LDFLAGS=" $( rpm -E ' %{?build_ldflags}' ) "
91
103
;;
92
104
esac
You can’t perform that action at this time.
0 commit comments