if(HAVE_W_ERROR_UNGUARDED_AVAILABILITY_NEW)
set(ADDITIONAL_CHECK_FLAGS "${ADDITIONAL_CHECK_FLAGS} -Werror=unguarded-availability-new")
endif()
+ check_c_compiler_flag(-Werror=unused-command-line-argument HAVE_W_ERROR_UNUSED_COMMAND_LINE_ARGUMENT)
+ if(HAVE_W_ERROR_UNUSED_COMMAND_LINE_ARGUMENT)
+ set(ADDITIONAL_CHECK_FLAGS "${ADDITIONAL_CHECK_FLAGS} -Werror=unused-command-line-argument")
+ endif()
endif()
#
#
# Check whether compiler supports -fno-semantic-interposition parameter
#
+set(CMAKE_REQUIRED_FLAGS "${ADDITIONAL_CHECK_FLAGS}")
check_c_compiler_flag(-fno-semantic-interposition HAVE_NO_INTERPOSITION)
+set(CMAKE_REQUIRED_FLAGS)
#
# Check if we can hide zlib internal symbols that are linked between separate source files using hidden
echo "Checking for -Werror=unguarded-availability-new... No." | tee -a configure.log
fi
+# Check for -Werror=unused-command-line-argument compiler support
+echo "" > test.c
+ cat > $test.c <<EOF
+int main() { return 0; }
+EOF
+if $cc $CFLAGS -Werror=unused-command-line-argument -c $test.c >> configure.log 2>&1; then
+ echo "Checking for -Werror=unused-command-line-argument... Yes." | tee -a configure.log
+ ADDITIONAL_CHECK_FLAGS="$ADDITIONAL_CHECK_FLAGS -Werror=unused-command-line-argument"
+else
+ echo "Checking for -Werror=unused-command-line-argument... No." | tee -a configure.log
+fi
+
# check for version script support
cat > $test.c <<EOF
int foo(void) { return 0; }
cat > $test.c <<EOF
int main() { return 0; }
EOF
-if test "$gcc" -eq 1 && ($cc $CFLAGS -fno-semantic-interposition -c $test.c) >> configure.log 2>&1; then
+if test "$gcc" -eq 1 && ($cc $CFLAGS $ADDITIONAL_CHECK_FLAGS -fno-semantic-interposition -c $test.c) >> configure.log 2>&1; then
echo "Checking for -fno-semantic-interposition... Yes." | tee -a configure.log
SFLAGS="$SFLAGS -fno-semantic-interposition"
else