Set CMAKE_CXX_STANDARD to 17 (#2824)
The Google Foundational C++ Support table requires C++17 as of
2024-12-17.
Update googletest to v1.17.0 for the following GCC 15 warning fix:
https://github.com/google/googletest/commit/00b2154e8
<ciso646> is deprecated in C++17, use <version> to detect
implementation-specific macros
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e2f463f..79018f5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,7 @@
* Set avifDecoder::image->depth to the same value after avifDecoderParse() as
after avifDecoderNextImage() when AVIF_ENABLE_EXPERIMENTAL_SAMPLE_TRANSFORM is
enabled and when the file to decode contains a 'sato' derived image item.
+* Update googletest.cmd/LocalGTest.cmake: v1.17.0
* Update rav1e.cmd/LocalRav1e.cmake: cargo-c v0.10.13, corrosion v0.5.2,
rav1e v0.8.0
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 991743c..04a70a3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -570,13 +570,8 @@
if(AVIF_LIB_USE_CXX OR AVIF_BUILD_APPS OR (AVIF_BUILD_TESTS AND (AVIF_FUZZTEST OR AVIF_GTEST)))
enable_language(CXX)
- if(AVIF_ENABLE_NODISCARD OR AVIF_CODEC_AVM_ENABLED)
- # [[nodiscard]] and tensorflow-lite require C++17.
- set(CMAKE_CXX_STANDARD 17)
- set(CMAKE_CXX_STANDARD_REQUIRED ON)
- else()
- set(CMAKE_CXX_STANDARD 14)
- endif()
+ set(CMAKE_CXX_STANDARD 17)
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
set_target_properties(avif_obj PROPERTIES C_VISIBILITY_PRESET hidden)
diff --git a/cmake/Modules/LocalGTest.cmake b/cmake/Modules/LocalGTest.cmake
index 588bd76..5850e6d 100644
--- a/cmake/Modules/LocalGTest.cmake
+++ b/cmake/Modules/LocalGTest.cmake
@@ -1,4 +1,4 @@
-set(AVIF_GTEST_GIT_TAG v1.16.0)
+set(AVIF_GTEST_GIT_TAG v1.17.0)
set(GTest_FOUND ON CACHE BOOL "")
set(GTEST_INCLUDE_DIRS ${AVIF_SOURCE_DIR}/ext/googletest/googletest/include)
diff --git a/ext/googletest.cmd b/ext/googletest.cmd
index 31d3324..959bf7e 100755
--- a/ext/googletest.cmd
+++ b/ext/googletest.cmd
@@ -7,7 +7,7 @@
: # If you're running this on Windows, be sure you've already run this (from your VC2019 install dir):
: # "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars64.bat"
-git clone -b v1.16.0 --depth 1 https://github.com/google/googletest.git
+git clone -b v1.17.0 --depth 1 https://github.com/google/googletest.git
: # The gtest_force_shared_crt option makes gtest link the Microsoft C runtime library (CRT) dynamically
: # on Windows: