From 6e99a4dcfccbb4cf0b016a33f2164e5de916b3db Mon Sep 17 00:00:00 2001 From: Ben Doherty Date: Tue, 20 Jun 2023 14:59:10 +0800 Subject: [PATCH] Turn off iOS exceptions in debug builds (#6912) --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a8f99ad338..976c3e4dab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -372,6 +372,12 @@ if (ANDROID OR IOS OR WEBGL) endif() endif() +# Turn off exceptions on iOS debug as well. This fixes an availability error we see when using +# std::visit, which is not supported on iOS 11.0 when exceptions are enabled. +if (IOS) + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-exceptions") +endif() + # With WebGL, we disable RTTI even for debug builds because we pass emscripten::val back and forth # between C++ and JavaScript in order to efficiently access typed arrays, which are unbound. # NOTE: This is not documented in emscripten so we should consider a different approach.