mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-26 04:57:40 +00:00 
			
		
		
		
	Add warning flags also for clang
This commit is contained in:
		| @@ -2352,14 +2352,14 @@ endif() | |||||||
| ################################################################################ | ################################################################################ | ||||||
| # Set compiler flags | # Set compiler flags | ||||||
| ################################################################################ | ################################################################################ | ||||||
|  | set(CXX_WARNING_FLAGS -Wall -Wextra) | ||||||
| if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) | if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) | ||||||
|     # Add warning flags |     # Add warning flags | ||||||
|     # For "-Wall" see https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html |     # For "-Wall" see https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html | ||||||
|     set(cxx_warning_flags -Wall -Wextra) |  | ||||||
|     if(NOT (CMAKE_VERSION VERSION_LESS "3.3")) |     if(NOT (CMAKE_VERSION VERSION_LESS "3.3")) | ||||||
|         add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:${cxx_warning_flags}>") |         add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:${CXX_WARNING_FLAGS}>") | ||||||
|     else() |     else() | ||||||
|         add_compile_options("$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:${cxx_warning_flags}>") |         add_compile_options("$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:${CXX_WARNING_FLAGS}>") | ||||||
|     endif() |     endif() | ||||||
|     if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0") |     if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0") | ||||||
|         add_compile_options(-Wno-missing-field-initializers) |         add_compile_options(-Wno-missing-field-initializers) | ||||||
| @@ -2368,6 +2368,13 @@ if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT WIN32) | |||||||
|         add_compile_options(-Wno-psabi) |         add_compile_options(-Wno-psabi) | ||||||
|     endif() |     endif() | ||||||
| endif() | endif() | ||||||
|  | if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||||||
|  |     if(NOT (CMAKE_VERSION VERSION_LESS "3.3")) | ||||||
|  |         add_compile_options("$<$<COMPILE_LANGUAGE:CXX>:${CXX_WARNING_FLAGS}>") | ||||||
|  |     else() | ||||||
|  |         add_compile_options("$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:${CXX_WARNING_FLAGS}>") | ||||||
|  |     endif() | ||||||
|  | endif() | ||||||
|  |  | ||||||
| # Processor-architecture related flags | # Processor-architecture related flags | ||||||
| # See https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html | # See https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Carles Fernandez
					Carles Fernandez