Enabling RTTI for clang tool?

c++, clang

Solution

The relevant variables are called `LLVM_ENABLE_RTTI` and `LLVM_ENABLE_EH`.

They can can be set either by using a cmake gui like `ccmake` or `cmake-gui`, or by passing them directly to the cmake invocation.

Problem

I'm experimenting with clang's libTooling to build a basic source-to-source transformation tool. I want to use `boost::regex` and `boost::filesystem`, but linking against them requires exceptions and RTTI be enabled. According to the clang mailing list , it should be possible to enable RTTI without breaking anything. That said, I can't find a setting or variable to instruct the build system to enable RTTI. (i'm using cmake). I can add the `-frtti` and `-fexceptions` flags to the compiler commands, but the clang build system is adding its own `-fno-rtti`, `-fno-exceptions` flags which seem to have higher priority.

Original source