cesium-unreal
cesium-unreal copied to clipboard
Fix bad_any_cast errors by disabling RTTI when building cesium-native
Fixes #1380
We're seeing bad_any_cast exceptions when loading tilesets with metadata, in release builds, on every platform except Windows. The cause appears to be that cesium-native is compiled with runtime type information (RTTI) enabled, but Cesium for Unreal - as required by Unreal Engine itself - is compiled with RTTI disabled. Windows isn't fussed about this, but apparently it causes subtle problems on Linux/Android/Apple.
This PR also includes a bug fix to the GetInteger64 metadata functions on non-Windows platforms. None of them were working because on 64-bit clang platforms (definitely Linux, pretty sure about the others):
std::int64_tis a typedef tosigned long int.- Unreal's
int64is a typedef tosigned long long.
Both are 64-bit and seemingly identical. But they're different types, so IsMetadataInteger<int64> evaluates to false. :upside_down_face:
So this PR makes sure we use int64_t instead of int64 when instantiating cesium-native's type traits templates.
Thanks @kring !