Browse Source

Add c++14 to QBT_ADD_CONFIG when appropriate

adaptive-webui-19844
Chocobo1 6 years ago
parent
commit
efe50baddc
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 22
      configure
  2. 15
      configure.ac

22
configure vendored

@ -5591,8 +5591,10 @@ $as_echo "yes" >&6; }
fi fi
# Check if already in >= C++14 mode because of the flags returned by one of the above packages # Check if already in >= C++14 mode because of the flags returned by one of the above packages
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler is using C++14 or later mode" >&5 TMP_CXXFLAGS="$CXXFLAGS"
$as_echo_n "checking if compiler is using C++14 or later mode... " >&6; } CXXFLAGS=""
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler defaults to C++14 or later mode" >&5
$as_echo_n "checking if compiler defaults to C++14 or later mode... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */ /* end confdefs.h. */
@ -5626,8 +5628,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test "x$QBT_CXX14_FOUND" = "xno"; then : if test "x$QBT_CXX14_FOUND" = "xno"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports C++14" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports C++14" >&5
$as_echo_n "checking if compiler supports C++14... " >&6; } $as_echo_n "checking if compiler supports C++14... " >&6; }
TMP_CXXFLAGS="$CXXFLAGS" CXXFLAGS="-std=c++14"
CXXFLAGS="$CXXFLAGS -std=c++14"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */ /* end confdefs.h. */
@ -5672,15 +5673,9 @@ _ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then : if ac_fn_cxx_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; } $as_echo "no" >&6; }
CXXFLAGS="$TMP_CXXFLAGS -std=c++14" QBT_ADD_CONFIG="$QBT_ADD_CONFIG c++14"
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C++14 mode is now force enabled. { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C++14 mode is now force enabled. The C++ mode should match the mode that other libraries were built with, otherwise you'll likely get linking errors." >&5
Make sure you use the same C++ mode for qBittorrent and its dependencies. $as_echo "$as_me: WARNING: C++14 mode is now force enabled. The C++ mode should match the mode that other libraries were built with, otherwise you'll likely get linking errors." >&2;}
To explicitly set qBittorrent to a later mode use CXXFLAGS.
Example: \`CXXFLAGS=\"\$CXXFLAGS -std=c++14\" ./configure\`" >&5
$as_echo "$as_me: WARNING: C++14 mode is now force enabled.
Make sure you use the same C++ mode for qBittorrent and its dependencies.
To explicitly set qBittorrent to a later mode use CXXFLAGS.
Example: \`CXXFLAGS=\"\$CXXFLAGS -std=c++14\" ./configure\`" >&2;}
else else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; } $as_echo "yes" >&6; }
@ -5695,6 +5690,7 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi fi
CXXFLAGS="$TMP_CXXFLAGS"
# These are required because autoconf doesn't expand these **particular** # These are required because autoconf doesn't expand these **particular**
# vars automatically. And qmake cannot autoexpand them. # vars automatically. And qmake cannot autoexpand them.

15
configure.ac

@ -210,7 +210,9 @@ PKG_CHECK_MODULES(zlib,
LIBS="$zlib_LIBS $LIBS"]) LIBS="$zlib_LIBS $LIBS"])
# Check if already in >= C++14 mode because of the flags returned by one of the above packages # Check if already in >= C++14 mode because of the flags returned by one of the above packages
AC_MSG_CHECKING([if compiler is using C++14 or later mode]) TMP_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=""
AC_MSG_CHECKING([if compiler defaults to C++14 or later mode])
AC_COMPILE_IFELSE([DETECT_CPP14_PROGRAM()], AC_COMPILE_IFELSE([DETECT_CPP14_PROGRAM()],
[AC_MSG_RESULT([yes]) [AC_MSG_RESULT([yes])
QBT_CXX14_FOUND="yes"], QBT_CXX14_FOUND="yes"],
@ -221,8 +223,7 @@ AC_COMPILE_IFELSE([DETECT_CPP14_PROGRAM()],
# and if yes, enable it leaving a warning to the user # and if yes, enable it leaving a warning to the user
AS_IF([test "x$QBT_CXX14_FOUND" = "xno"], AS_IF([test "x$QBT_CXX14_FOUND" = "xno"],
[AC_MSG_CHECKING([if compiler supports C++14]) [AC_MSG_CHECKING([if compiler supports C++14])
TMP_CXXFLAGS="$CXXFLAGS" CXXFLAGS="-std=c++14"
CXXFLAGS="$CXXFLAGS -std=c++14"
AC_COMPILE_IFELSE([DETECT_CPP14_PROGRAM()], AC_COMPILE_IFELSE([DETECT_CPP14_PROGRAM()],
[AC_MSG_RESULT([yes]) [AC_MSG_RESULT([yes])
AC_MSG_CHECKING([if C++14 is disabled by the set compiler flags]) AC_MSG_CHECKING([if C++14 is disabled by the set compiler flags])
@ -230,16 +231,14 @@ AS_IF([test "x$QBT_CXX14_FOUND" = "xno"],
CXXFLAGS="-std=c++14 $TMP_CXXFLAGS" CXXFLAGS="-std=c++14 $TMP_CXXFLAGS"
AC_COMPILE_IFELSE([DETECT_CPP14_PROGRAM()], AC_COMPILE_IFELSE([DETECT_CPP14_PROGRAM()],
[AC_MSG_RESULT([no]) [AC_MSG_RESULT([no])
CXXFLAGS="$TMP_CXXFLAGS -std=c++14" QBT_ADD_CONFIG="$QBT_ADD_CONFIG c++14"
AC_MSG_WARN([C++14 mode is now force enabled. AC_MSG_WARN([C++14 mode is now force enabled. The C++ mode should match the mode that other libraries were built with, otherwise you'll likely get linking errors.])],
Make sure you use the same C++ mode for qBittorrent and its dependencies.
To explicitly set qBittorrent to a later mode use CXXFLAGS.
Example: `CXXFLAGS="\$CXXFLAGS -std=c++14" ./configure`])],
[AC_MSG_RESULT([yes]) [AC_MSG_RESULT([yes])
AC_MSG_ERROR([The compiler supports C++14 but the user or a dependency has explicitly enabled a lower mode.])])], AC_MSG_ERROR([The compiler supports C++14 but the user or a dependency has explicitly enabled a lower mode.])])],
[AC_MSG_RESULT([no]) [AC_MSG_RESULT([no])
AC_MSG_ERROR([A compiler supporting C++14 is required.])]) AC_MSG_ERROR([A compiler supporting C++14 is required.])])
]) ])
CXXFLAGS="$TMP_CXXFLAGS"
# These are required because autoconf doesn't expand these **particular** # These are required because autoconf doesn't expand these **particular**
# vars automatically. And qmake cannot autoexpand them. # vars automatically. And qmake cannot autoexpand them.

Loading…
Cancel
Save