I did not find a good way to get the STL version, except checking the file name 
of libstdc++.so.version. From another perspective, what we know is that the 
default STL version inside CentOS6.5 requires RTTI, we do not know if any other 
version requires RTTI, imho, it is better to export this option instead of 
checking a specific version number in cmake. Otherwise, users need to modify 
CMakeLists to add another version number when he meets the case.

-----Original Message-----
From: Beignet [mailto:[email protected]] On Behalf Of 
Zhigang Gong
Sent: Wednesday, January 07, 2015 10:26 AM
To: Guo, Yejun
Cc: [email protected]
Subject: Re: [Beignet] [PATCH 3/3] add CMAKE option ENABLE_RTTI for some stl 
version

Could you find out the specified STL version? And do some checking at 
configuration time and remove or add fno-rtti according to the checking resul?

Thanks.

On Wed, Dec 31, 2014 at 03:36:24PM +0800, Guo Yejun wrote:
> for some STL version, unable to build with -fno-rtti, have to enable it.
> 
> Signed-off-by: Guo Yejun <[email protected]>
> ---
>  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
> 
> _______________________________________________
> Beignet mailing list
> [email protected]
> http://lists.freedesktop.org/mailman/listinfo/beignet
_______________________________________________
Beignet mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/beignet
_______________________________________________
Beignet mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/beignet

Reply via email to