summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiarhei Fedartsou <siarhei.fedartsou@mapbox.com>2020-01-27 16:24:16 +0300
committerSiarhei Fedartsou <siarhei.fedartsou@mapbox.com>2020-01-27 16:24:16 +0300
commite205708b57eb49a001cfe2daa405cddbb56d7afa (patch)
tree6667e0177cac9af4c566020b8d25ef2177d202e1
parent391a5642e0b6ce1a07debfadd7619baf5bb04c9e (diff)
downloadqtlocation-mapboxgl-upstream/sfedartsou-make-rtti-optional.tar.gz
[build] Add WITH_NO_RTTI CMake option to be able to build gl-native with RTTI if neededupstream/sfedartsou-make-rtti-optional
-rw-r--r--CMakeLists.txt5
1 files changed, 4 insertions, 1 deletions
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