Skip to content

Commit

Permalink
Fix bad_any_cast errors by disabling RTTI.
Browse files Browse the repository at this point in the history
UE disables it, and apparently on Linux/Android/Apple, mixing libraries
compiled with and without RTTI is a mess.
  • Loading branch information
kring committed Jul 2, 2024
1 parent 8ed7665 commit e46b86e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions extern/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ set(CMAKE_RELWITHDEBINFO_POSTFIX ${CESIUM_RELEASE_POSTFIX})
# On Mac and Linux, Unreal uses -fvisibility-ms-compat.
# On Android, it uses -fvisibility=hidden
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-ms-compat -fvisibility-inlines-hidden")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-ms-compat -fvisibility-inlines-hidden -fno-rtti")
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Android")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden -fno-rtti")
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "iOS")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fno-rtti")
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
# Unreal Engine adds /Zp8 in 64-bit Windows builds to align structs to 8 bytes instead of the
# default of 16 bytes. There's this nice note in the documentation for that option:
Expand Down

0 comments on commit e46b86e

Please sign in to comment.