From e211b40a82eecafc2400079b38a4076bc743b9a2 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Mon, 27 Jan 2020 16:24:16 +0300 Subject: [build] Add WITH_NO_RTTI CMake option to be able to build gl-native with RTTI if needed --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9afded1deb..2547cfd5ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,7 @@ option(WITH_OSMESA "Use OSMesa headless backend" OFF) option(WITH_EGL "Use EGL backend" OFF) option(WITH_NODEJS "Download test dependencies like NPM and Node.js" ON) option(WITH_ERROR "Add -Werror flag to build (turns warnings into errors)" ON) +option(WITH_NO_RTTI "Disable RTTI" ON) if (WITH_ERROR) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") @@ -80,7 +81,9 @@ else() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wshadow -Wno-variadic-macros -Wno-unknown-pragmas") endif() -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") +if(WITH_NO_RTTI) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") +endif() if(APPLE AND CMAKE_CXX_COMPILER_ID MATCHES ".*Clang") # -Wno-error=unused-command-line-argument is required due to https://llvm.org/bugs/show_bug.cgi?id=7798 -- cgit v1.2.1