Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enabling RTTI for clang tool?

Tags:

c++

clang

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.

like image 625
Benno Avatar asked Jan 28 '14 16:01

Benno


1 Answers

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.

like image 191
Benno Avatar answered Sep 22 '22 07:09

Benno