Skip to content

Commit

Permalink
Add parameter to enable RTTI for Unix
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Jaques committed May 23, 2019
1 parent 591d213 commit 71ab924
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/CompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,13 @@ if(CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
if (NOT ${ALLOW_EXCEPTIONS})
list(APPEND COMPILER_FLAGS "-fno-exceptions")
endif()

if (NOT DEFINED ALLOW_RTTI)
option(ALLOW_RTTI "Allow runtime type information (RTTI)" OFF)
endif()
if (NOT ${ALLOW_RTTI})
list(APPEND COMPILER_FLAGS "-fno-rtti") # disable runtime type information
endif()
endif()

string(REPLACE ";" " " COMPILER_FLAGS_STRING "${COMPILER_FLAGS}")
Expand Down

0 comments on commit 71ab924

Please sign in to comment.