diff options
author | Gael Guennebaud <g.gael@free.fr> | 2013-02-15 14:01:30 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2013-02-15 14:01:30 +0100 |
commit | 19f699ded01acff389f3559094cacfb5245816fb (patch) | |
tree | c6f72ecd1cc5183b4849da37c788fe364f2c069c /CMakeLists.txt | |
parent | 8745da14d8609425764c399c6ac1f44235277ef3 (diff) |
"-Wno-psabi" option is not supported by all gcc version.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 52d7cdf7e..ff21a9802 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -110,9 +110,14 @@ add_definitions("-DEIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS") set(EIGEN_TEST_MAX_SIZE "320" CACHE STRING "Maximal matrix/vector size, default is 320") if(CMAKE_COMPILER_IS_GNUCXX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-psabi -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -fexceptions -fno-check-new -fno-common -fstrict-aliasing") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -fexceptions -fno-check-new -fno-common -fstrict-aliasing") set(CMAKE_CXX_FLAGS_DEBUG "-g3") set(CMAKE_CXX_FLAGS_RELEASE "-g0 -O2") + + check_cxx_compiler_flag("-Wno-psabi" COMPILER_SUPPORT_WNOPSABI) + if(COMPILER_SUPPORT_WNOPSABI) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-psabi") + endif() check_cxx_compiler_flag("-Wno-variadic-macros" COMPILER_SUPPORT_WNOVARIADICMACRO) if(COMPILER_SUPPORT_WNOVARIADICMACRO) |