Merge pull request #3994 from fanquake/no_werror_macos

build: compile with -Werror by default on Darwin
This commit is contained in:
Luca Boccassi 2020-07-21 11:15:38 +01:00 committed by GitHub
commit 49f4c1898b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -196,7 +196,7 @@ else
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
fi fi
# By default compiling with -Werror except OSX and on Solaris when building # By default compiling with -Werror except on OSX and Solaris when building
# with libsodium. # with libsodium.
AC_ARG_ENABLE([Werror], AC_ARG_ENABLE([Werror],
[AS_HELP_STRING([--disable-Werror], [disable Werror compiler flag [default=enabled]])], [AS_HELP_STRING([--disable-Werror], [disable Werror compiler flag [default=enabled]])],
@ -278,7 +278,6 @@ case "${host_os}" in
# Define on Darwin to enable all library features # Define on Darwin to enable all library features
CPPFLAGS="-D_DARWIN_C_SOURCE $CPPFLAGS" CPPFLAGS="-D_DARWIN_C_SOURCE $CPPFLAGS"
libzmq_pedantic="no" libzmq_pedantic="no"
libzmq_werror="no"
AC_DEFINE(ZMQ_HAVE_OSX, 1, [Have DarwinOSX OS]) AC_DEFINE(ZMQ_HAVE_OSX, 1, [Have DarwinOSX OS])
;; ;;
*haiku*) *haiku*)
@ -560,13 +559,18 @@ elif test "x$with_libsodium" = "xyes"; then
curve_library="libsodium" curve_library="libsodium"
enable_curve="yes" enable_curve="yes"
# On Solaris, libsodium depends on libssp
case "${host_os}" in case "${host_os}" in
*solaris*) *solaris*)
dnl On Solaris, libsodium depends on libssp
LDFLAGS="-lssp $LDFLAGS" LDFLAGS="-lssp $LDFLAGS"
libzmq_pedantic="no" libzmq_pedantic="no"
libzmq_werror="no" libzmq_werror="no"
;; ;;
*darwin*)
dnl On Darwin, building with libsodium causes
dnl macro redefinition warnings
libzmq_werror="no"
;;
esac esac
PKGCFG_NAMES_PRIVATE="$PKGCFG_NAMES_PRIVATE libsodium" PKGCFG_NAMES_PRIVATE="$PKGCFG_NAMES_PRIVATE libsodium"