I need to enable RTTI to use third party libraries (boost, cereal). I set bUseRTTI = true; in *.Build.cs to enable RTTI.
It works on Windows, but on OS X there are bunch of compile time errors show -fno-rtti is on.
Unlike In VCToolChain.cs, there is no code that handles CompileEnvironment.Config.bUseRTTI in MacToolChain.cs.
If I manullay handle CompileEnvironment.Config.bUseRTTI to set -fno-rtti in the MacToolChain.cs then the problem solved.
Is there any special reason you guys didn’t handled it on OS X? or is it just a mistake?
I looped in another developer and was able to grab information about this.
"RTTI is generally not used in games, due to the amount of extra data it generates and links into your executable, for every polymorphic type, even if you don’t use end up using RTTI on that type.
Game engines usually produce their own runtime reflection solutions which are tuned to the individual needs of the engine, like we do with the UObject system. And so, we probably didn’t have any Mac users who needed that before."
I have gone ahead and entered a feature request for this issue, UE-20314. I cannot guarantee it will make it, but I can promise I will add as much community interest as is applicable that are interested in seeing this feature added.
Thank you for taking the time to request this feature. Look to our Release Notes in major upcoming releases to updates for this feature request.
I need this too. The answer ignores that we develop games and TOOLS and often we can’t change third-party code.
I think this restriction should be handled as a custom parameter. Thank you.
“RTTI is generally not used in games, due to the amount of extra data it generates and links into your executable, for every polymorphic type, even if you don’t use end up using RTTI on that type.
Game engines usually produce their own runtime reflection solutions which are tuned to the individual needs of the engine, like we do with the UObject system. And so, we probably didn’t have any Mac users who needed that before.”
Also, I just stumbled over ‘Wno-reorder’ in my third party source.
It would be great, if we could add compiler settings to a .cs file to configure the build system for Mac and Win.
I’m not yet sure, what already can be changed with the current version.
I have entered a feature request for the issue, and that is currently all I can do or provide in the way of getting this implemented. You will be able to track this issue in the very near future publicly so you can vote on this issue to be implemented.
this currently is an absolute showstopper for me. Almost all libraries I work with use the common concept of dynamic_cast<> all over the place. Not to talk about my own libraries.
Would you please talk with your expert, how I could workaround this problem by modifying the Unreal build system on my Mac?
You can track and vote for the issue on our newly announced Unreal Engine Issues tracker. Aside from that, the developer is going to address this issue as resources become available and he can dedicate time to getting a fix.
I am using the engine that built from source not the prebuilt one via the launcher.
UnrealEngine-4.12.5-release/Engine/Source/Programs/UnrealBuildTool/Mac/MacToolChain.cs
That’s the problem. This file doesn’t exist in the standard launcher installation. It’s a pity, it would be so easy to solve my problem, if I could change that configuration.