add -Wextra only if compiler supports it
This commit is contained in:
		
							parent
							
								
									834eb5bfc8
								
							
						
					
					
						commit
						23f073625d
					
				| @ -17,6 +17,8 @@ endif(EIGEN_SVN_REVISION) | ||||
| 
 | ||||
| cmake_minimum_required(VERSION 2.6.2) | ||||
| 
 | ||||
| include(CheckCXXCompilerFlag) | ||||
| 
 | ||||
| set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) | ||||
| 
 | ||||
| option(EIGEN_BUILD_TESTS "Build tests" OFF) | ||||
| @ -34,7 +36,13 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||||
| 
 | ||||
| if(CMAKE_COMPILER_IS_GNUCXX) | ||||
|   if(CMAKE_SYSTEM_NAME MATCHES Linux) | ||||
|     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 -Wextra -fno-exceptions -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 -fno-exceptions -fno-check-new -fno-common -fstrict-aliasing") | ||||
| 
 | ||||
|     check_cxx_compiler_flag("-Wextra" COMPILER_SUPPORT_WEXTRA) | ||||
|     if(COMPILER_SUPPORT_WEXTRA) | ||||
|       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra") | ||||
|     endif() | ||||
| 
 | ||||
|     if(NOT EIGEN_TEST_LIB) | ||||
|       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic") | ||||
|     endif(NOT EIGEN_TEST_LIB) | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Gael Guennebaud
						Gael Guennebaud