mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-21 05:43:32 -07:00
Enforce C++14 requirement
This commit is contained in:
parent
6bd5d0b8e9
commit
814488863d
3 changed files with 46 additions and 46 deletions
48
configure
vendored
48
configure
vendored
|
@ -5590,16 +5590,16 @@ $as_echo "yes" >&6; }
|
|||
LIBS="$zlib_LIBS $LIBS"
|
||||
fi
|
||||
|
||||
# Check if already in >= C++11 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++11 or later mode" >&5
|
||||
$as_echo_n "checking if compiler is using C++11 or later mode... " >&6; }
|
||||
# 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
|
||||
$as_echo_n "checking if compiler is using C++14 or later mode... " >&6; }
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#ifndef __cplusplus
|
||||
#error "This is not a C++ compiler"
|
||||
#elif __cplusplus < 201103L
|
||||
#error "This is not a C++11 compiler"
|
||||
#elif __cplusplus < 201402L
|
||||
#error "This is not a C++14 compiler"
|
||||
#endif
|
||||
int
|
||||
main ()
|
||||
|
@ -5613,28 +5613,28 @@ _ACEOF
|
|||
if ac_fn_cxx_try_compile "$LINENO"; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
QBT_CXX11_FOUND="yes"
|
||||
QBT_CXX14_FOUND="yes"
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
QBT_CXX11_FOUND="no"
|
||||
QBT_CXX14_FOUND="no"
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
|
||||
# In case of no, check if the compiler can support at least C++11
|
||||
# In case of no, check if the compiler can support at least C++14
|
||||
# and if yes, enable it leaving a warning to the user
|
||||
if test "x$QBT_CXX11_FOUND" = "xno"; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports C++11" >&5
|
||||
$as_echo_n "checking if compiler supports C++11... " >&6; }
|
||||
if test "x$QBT_CXX14_FOUND" = "xno"; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports C++14" >&5
|
||||
$as_echo_n "checking if compiler supports C++14... " >&6; }
|
||||
TMP_CXXFLAGS="$CXXFLAGS"
|
||||
CXXFLAGS="$CXXFLAGS -std=c++11"
|
||||
CXXFLAGS="$CXXFLAGS -std=c++14"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#ifndef __cplusplus
|
||||
#error "This is not a C++ compiler"
|
||||
#elif __cplusplus < 201103L
|
||||
#error "This is not a C++11 compiler"
|
||||
#elif __cplusplus < 201402L
|
||||
#error "This is not a C++14 compiler"
|
||||
#endif
|
||||
int
|
||||
main ()
|
||||
|
@ -5648,17 +5648,17 @@ _ACEOF
|
|||
if ac_fn_cxx_try_compile "$LINENO"; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if C++11 is disabled by the set compiler flags" >&5
|
||||
$as_echo_n "checking if C++11 is disabled by the set compiler flags... " >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if C++14 is disabled by the set compiler flags" >&5
|
||||
$as_echo_n "checking if C++14 is disabled by the set compiler flags... " >&6; }
|
||||
# prepend the flag so it won't override conflicting user defined flags
|
||||
CXXFLAGS="-std=c++11 $TMP_CXXFLAGS"
|
||||
CXXFLAGS="-std=c++14 $TMP_CXXFLAGS"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#ifndef __cplusplus
|
||||
#error "This is not a C++ compiler"
|
||||
#elif __cplusplus < 201103L
|
||||
#error "This is not a C++11 compiler"
|
||||
#elif __cplusplus < 201402L
|
||||
#error "This is not a C++14 compiler"
|
||||
#endif
|
||||
int
|
||||
main ()
|
||||
|
@ -5672,25 +5672,25 @@ _ACEOF
|
|||
if ac_fn_cxx_try_compile "$LINENO"; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
CXXFLAGS="$TMP_CXXFLAGS -std=c++11"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: C++11 mode is now force enabled.
|
||||
CXXFLAGS="$TMP_CXXFLAGS -std=c++14"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: 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\`" >&5
|
||||
$as_echo "$as_me: WARNING: C++11 mode is now force enabled.
|
||||
$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
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
as_fn_error $? "The compiler supports C++11 but the user or a dependency has explicitly enabled a lower mode." "$LINENO" 5
|
||||
as_fn_error $? "The compiler supports C++14 but the user or a dependency has explicitly enabled a lower mode." "$LINENO" 5
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
as_fn_error $? "A compiler supporting C++11 is required." "$LINENO" 5
|
||||
as_fn_error $? "A compiler supporting C++14 is required." "$LINENO" 5
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue