diff --git a/CMakeLists.txt b/CMakeLists.txt index 6770a86119..2beb9d996b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -645,7 +645,11 @@ endif() if(AVIF_USE_CXX) enable_language(CXX) - set(CMAKE_CXX_STANDARD 14) + if(AVIF_ENABLE_NODISCARD) + set(CMAKE_CXX_STANDARD 17) + else() + set(CMAKE_CXX_STANDARD 14) + endif() endif() option(AVIF_BUILD_APPS "Build avif apps." OFF)