[Beignet] [PATCH 3/3] add CMAKE option ENABLE_RTTI for some stl version
Guo Yejun
yejun.guo at intel.com
Tue Dec 30 23:36:24 PST 2014
for some STL version, unable to build with -fno-rtti, have to enable it.
Signed-off-by: Guo Yejun <yejun.guo at intel.com>
---
CMakeLists.txt | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5cb31c2..9b9c9ea 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -65,7 +65,13 @@ elseif (COMPILER STREQUAL "CLANG")
elseif (COMPILER STREQUAL "ICC")
set (CMAKE_C_CXX_FLAGS "${CMAKE_C_CXX_FLAGS} -wd2928 -Wall -fPIC -fstrict-aliasing -fp-model fast -msse4.1 -Wl,-E")
endif ()
-set (CMAKE_CXX_FLAGS "${CMAKE_C_CXX_FLAGS} -std=c++0x -Wno-invalid-offsetof -fno-rtti")
+
+set (CMAKE_CXX_FLAGS "${CMAKE_C_CXX_FLAGS} -std=c++0x -Wno-invalid-offsetof")
+
+if (NOT ENABLE_RTTI)
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
+endif ()
+
set (CMAKE_C_FLAGS "${CMAKE_C_CXX_FLAGS}")
set (CMAKE_CXX_FLAGS_DEBUG "-O0 -g -DGBE_DEBUG=1")
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DGBE_DEBUG=1")
--
1.9.1
More information about the Beignet
mailing list