Remove exceptions on iOS (#3600)

This commit is contained in:
Ben Doherty
2021-03-02 10:38:19 -08:00
committed by GitHub
parent 7fa2053c55
commit 8d6e794486
2 changed files with 14 additions and 2 deletions
+1 -1
View File
@@ -299,7 +299,7 @@ endif()
# On Android RELEASE builds, we disable exceptions and RTTI to save some space (about 75 KiB
# saved by -fno-exception and 10 KiB saved by -fno-rtti).
if (ANDROID OR WEBGL)
if (ANDROID OR IOS OR WEBGL)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti")
endif()
+13 -1
View File
@@ -104,7 +104,7 @@ endif()
# ==================================================================================================
if (FILAMENT_SUPPORTS_METAL)
list(APPEND SRCS
set(METAL_SRCS
src/metal/MetalBlitter.mm
src/metal/MetalBuffer.mm
src/metal/MetalBufferPool.mm
@@ -117,6 +117,18 @@ if (FILAMENT_SUPPORTS_METAL)
src/metal/MetalTimerQuery.mm
src/metal/PlatformMetal.mm
)
list(APPEND SRCS ${METAL_SRCS})
if (IOS)
# Objective-C++ sources need an additional compiler flag on iOS to disable exceptions.
set_property(SOURCE
${METAL_SRCS}
src/opengl/PlatformCocoaTouchGL.mm
src/opengl/CocoaTouchExternalImage.mm
src/opengl/PlatformCocoaGL.mm
PROPERTY COMPILE_FLAGS -fno-objc-exceptions)
endif()
endif()
# ==================================================================================================