diff --git a/filament/CMakeLists.txt b/filament/CMakeLists.txt index 924ca1c52a0..4fe1c604017 100644 --- a/filament/CMakeLists.txt +++ b/filament/CMakeLists.txt @@ -607,6 +607,13 @@ else() -Wover-aligned -Werror ) + if (CMAKE_CXX_STANDARD EQUAL 20) + # The lambdas for passes in PostProcessManager.cpp capture this + # implicitly in a way that's deprecated in c++20, but can't easily be + # fixed in a way that's backwards compatible with c++17: + # https://www.nextptr.com/tutorial/ta1430524603/capture-this-in-lambda-expression-timeline-of-change + list(APPEND FILAMENT_WARNINGS -Wno-deprecated-this-capture) + endif() endif() target_compile_options(${TARGET} PRIVATE diff --git a/libs/gltfio/CMakeLists.txt b/libs/gltfio/CMakeLists.txt index c7c7d6a63c0..373df1f8a69 100644 --- a/libs/gltfio/CMakeLists.txt +++ b/libs/gltfio/CMakeLists.txt @@ -197,6 +197,11 @@ if (WEBGL_PTHREADS) endif() set(GLTFIO_WARNINGS -Wall -Werror) +if (CMAKE_CXX_STANDARD EQUAL 20) + # The following things used by AssetLoader.cpp are deprecated in c++20: + # wstring_convert and std::codecvt_utf8. + list(APPEND GLTFIO_WARNINGS -Wno-deprecated-declarations) +endif() if (NOT MSVC) target_compile_options(gltfio_core PRIVATE ${GLTFIO_WARNINGS}) endif()