Skip to content

Commit

Permalink
Bump C++ requirement to C++17
Browse files Browse the repository at this point in the history
The 1.13.0 release of Poco requires a newer version of C++, specifically
C++17. The configuration phase will fail to find the Poco headers with
an older C++ version.

Changelog: https://raw.githubusercontent.com/pocoproject/poco/poco-1.13.0-release/CHANGELOG
Nixpkgs patch: https://github.com/NixOS/nixpkgs/blob/6dd5612cdd562163dc7a7341e3be9c3f6f4d9078/pkgs/tools/graphics/sanjuuni/default.nix#L22-L26
Relevant discussion: NixOS/nixpkgs#283809 (comment)
  • Loading branch information
tomodachi94 committed Mar 25, 2024
1 parent 8abef54 commit 434e8fb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Nix support is maintained by [Tomodachi94](https://github.com/tomodachi94). For

## Building
Requirements:
* C++11 or later compiler
* C++17 or later compiler
* FFmpeg libraries
* Poco (Foundation and Util required; Net/NetSSL optional)
* zlib (usually required by Poco)
Expand Down
12 changes: 6 additions & 6 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -2522,7 +2522,7 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu

CXXFLAGS="$CXXFLAGS -std=c++11"
CXXFLAGS="$CXXFLAGS -std=c++17"



Expand Down Expand Up @@ -3808,7 +3808,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$ac_cxx_conftest_cxx11_program
_ACEOF
for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA
for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++17 -std=c++0x -qlanglvl=extended0x -AA
do
CXX="$ac_save_CXX $ac_arg"
if ac_fn_cxx_try_compile "$LINENO"
Expand Down Expand Up @@ -3894,15 +3894,15 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu


{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -std=c++11" >&5
printf %s "checking whether C++ compiler accepts -std=c++11... " >&6; }
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts -std=c++17" >&5
printf %s "checking whether C++ compiler accepts -std=c++17... " >&6; }
if test ${ax_cv_check_cxxflags___std_cpp11+y}
then :
printf %s "(cached) " >&6
else $as_nop

ax_check_save_flags=$CXXFLAGS
CXXFLAGS="$CXXFLAGS -std=c++11"
CXXFLAGS="$CXXFLAGS -std=c++17"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
Expand All @@ -3929,7 +3929,7 @@ if test "x$ax_cv_check_cxxflags___std_cpp11" = xyes
then :
:
else $as_nop
as_fn_error $? "C++ compiler does not support -std=c++11." "$LINENO" 5
as_fn_error $? "C++ compiler does not support -std=c++17." "$LINENO" 5
fi


Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ m4_include([m4/find_cxx.m4])
m4_include([m4/find_cxx11.m4])

AC_LANG([C++])
CXXFLAGS="$CXXFLAGS -std=c++11"
CXXFLAGS="$CXXFLAGS -std=c++17"
AC_PROG_CC
AC_PROG_CXX
AX_CHECK_COMPILE_FLAG([-std=c++11], [], [AC_MSG_ERROR([C++ compiler does not support -std=c++11.])])
AX_CHECK_COMPILE_FLAG([-std=c++17], [], [AC_MSG_ERROR([C++ compiler does not support -std=c++17.])])

AC_CHECK_HEADERS([libavformat/avformat.h], [], [AC_MSG_ERROR([Could not find libavformat headers.])])
AC_CHECK_HEADERS([libavcodec/avcodec.h], [], [AC_MSG_ERROR([Could not find libavcodec headers.])])
Expand Down

0 comments on commit 434e8fb

Please sign in to comment.