The new environment variable provides means to declare all or some tcpdump
cmake run of a specific environment (CI or a working copy) as tainted.
Add explicit conditions to exempt the cmake run that emit warnings
now and request the compiler to treat warnings as errors *iff* the cmake
run is not tainted. This way if a cmake run that is warning-free now
degrades later, CI will fail it.
The treat warnings as errors cmake option used is:
-Werror=dev
Make developer warnings errors.
Make warnings that are meant for the author of the CMake-
Lists.txt files errors. By default this will also turn on depre-
cated warnings as errors.
(cherry picked from commit
625657ada89f6ab9056e3f918edb7052d3067438)
: "${CRYPTO:=no}"
: "${SMB:=no}"
: "${TCPDUMP_TAINTED:=no}"
: "${CRYPTO:=no}"
: "${SMB:=no}"
: "${TCPDUMP_TAINTED:=no}"
+: "${TCPDUMP_CMAKE_TAINTED:=no}"
: "${MAKE_BIN:=make}"
. ./build_common.sh
: "${MAKE_BIN:=make}"
. ./build_common.sh
[ "$TCPDUMP_TAINTED" != yes ] && CFLAGS=`cc_werr_cflags`
[ "$TCPDUMP_TAINTED" != yes ] && CFLAGS=`cc_werr_cflags`
+# If necessary, set TCPDUMP_CMAKE_TAINTED here to exempt particular cmake from
+# warnings. Use as specific terms as possible (e.g. some specific version and
+# some specific OS).
+
+[ "$TCPDUMP_CMAKE_TAINTED" != yes ] && CMAKE_OPTIONS='-Werror=dev'
+
if [ "$CMAKE" = no ]; then
if [ "$BUILD_LIBPCAP" = yes ]; then
echo "Using PKG_CONFIG_PATH=$PKG_CONFIG_PATH"
if [ "$CMAKE" = no ]; then
if [ "$BUILD_LIBPCAP" = yes ]; then
echo "Using PKG_CONFIG_PATH=$PKG_CONFIG_PATH"
run_after_echo mkdir build
run_after_echo cd build
if [ "$BUILD_LIBPCAP" = yes ]; then
run_after_echo mkdir build
run_after_echo cd build
if [ "$BUILD_LIBPCAP" = yes ]; then
- run_after_echo cmake -DWITH_CRYPTO="$CRYPTO" -DENABLE_SMB="$SMB" \
+ run_after_echo cmake "$CMAKE_OPTIONS" \
+ -DWITH_CRYPTO="$CRYPTO" -DENABLE_SMB="$SMB" \
${CFLAGS:+-DEXTRA_CFLAGS="$CFLAGS"} \
-DCMAKE_INSTALL_PREFIX="$PREFIX" -DCMAKE_PREFIX_PATH="$PREFIX" ..
LD_LIBRARY_PATH="$PREFIX/lib"
export LD_LIBRARY_PATH
else
${CFLAGS:+-DEXTRA_CFLAGS="$CFLAGS"} \
-DCMAKE_INSTALL_PREFIX="$PREFIX" -DCMAKE_PREFIX_PATH="$PREFIX" ..
LD_LIBRARY_PATH="$PREFIX/lib"
export LD_LIBRARY_PATH
else
- run_after_echo cmake -DWITH_CRYPTO="$CRYPTO" -DENABLE_SMB="$SMB" \
+ run_after_echo cmake "$CMAKE_OPTIONS" \
+ -DWITH_CRYPTO="$CRYPTO" -DENABLE_SMB="$SMB" \
${CFLAGS:+-DEXTRA_CFLAGS="$CFLAGS"} \
-DCMAKE_INSTALL_PREFIX="$PREFIX" ..
fi
${CFLAGS:+-DEXTRA_CFLAGS="$CFLAGS"} \
-DCMAKE_INSTALL_PREFIX="$PREFIX" ..
fi
: "${MATRIX_CMAKE:=no yes}"
: "${MATRIX_CRYPTO:=no yes}"
: "${MATRIX_SMB:=no yes}"
: "${MATRIX_CMAKE:=no yes}"
: "${MATRIX_CRYPTO:=no yes}"
: "${MATRIX_SMB:=no yes}"
+# Set this variable to "yes" before calling this script to disregard all cmake
+# warnings in a particular environment (CI or a local working copy). Set it
+# to "yes" in this script or in build.sh when a matrix subset is known to be
+# not cmake warning-free because of the version or whatever other factor
+# that the scripts can detect both in and out of CI.
+: "${TCPDUMP_CMAKE_TAINTED:=no}"
# Set this variable to "yes" before calling this script to disregard all
# warnings in a particular environment (CI or a local working copy). Set it
# to "yes" in this script or in build.sh when a matrix subset is known to be
# Set this variable to "yes" before calling this script to disregard all
# warnings in a particular environment (CI or a local working copy). Set it
# to "yes" in this script or in build.sh when a matrix subset is known to be
fi
COUNT=0
export TCPDUMP_TAINTED
fi
COUNT=0
export TCPDUMP_TAINTED
+export TCPDUMP_CMAKE_TAINTED
export MAKE_BIN
build_tcpdump() {
export MAKE_BIN
build_tcpdump() {