Skip to content

Commit

Permalink
Turn off iOS exceptions in debug builds (#6912)
Browse files Browse the repository at this point in the history
  • Loading branch information
bejado committed Jun 20, 2023
1 parent 35c9182 commit 6e99a4d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 6e99a4d

Please sign in to comment.