From 7f217866a7d9b837bffc8066d48cf18977e8509f Mon Sep 17 00:00:00 2001 From: Gon Solo Date: Thu, 23 Oct 2025 11:23:58 +0200 Subject: [PATCH 1/2] Suppress a deprecation warning. The solution for the warning in string.cpp will only arrive in C++26. --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 76d9397a8..95071260f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -660,6 +660,14 @@ SET (PBRT_UTIL_SOURCE src/pbrt/util/vecmath.cpp ) +# A warning about a deprecated function in C++17 but the solution will only be +# in C++26. +set_source_files_properties( + src/pbrt/util/string.cpp + PROPERTIES + COMPILE_FLAGS "-Wno-deprecated-declarations" +) + SET (PBRT_UTIL_SOURCE_HEADERS src/pbrt/util/args.h src/pbrt/util/bluenoise.h From da60a89ca2d8e69b8e548ff824f28aed70df1fdd Mon Sep 17 00:00:00 2001 From: Gon Solo Date: Fri, 24 Oct 2025 08:47:06 +0200 Subject: [PATCH 2/2] Restrict to GCC and Clang. --- CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 95071260f..79d7922f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -662,11 +662,13 @@ SET (PBRT_UTIL_SOURCE # A warning about a deprecated function in C++17 but the solution will only be # in C++26. -set_source_files_properties( - src/pbrt/util/string.cpp - PROPERTIES - COMPILE_FLAGS "-Wno-deprecated-declarations" -) +if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") + set_source_files_properties( + src/pbrt/util/string.cpp + PROPERTIES + COMPILE_FLAGS "-Wno-deprecated-declarations" + ) +endif() SET (PBRT_UTIL_SOURCE_HEADERS src/pbrt/util/args.h