mirror of
				https://github.com/eclipse/upm.git
				synced 2025-11-04 09:05:34 +03:00 
			
		
		
		
	bitbake: Fix for pthreads C test w/yocto
Fixed a problem where the C/CXX compile flags were getting overwritten. Fixed warnings in a few sensor drivers. This commit fixes #485 Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
		@@ -71,6 +71,7 @@ include (CheckCXXCompilerFlag)
 | 
			
		||||
# This function checks to see if each flag is supported
 | 
			
		||||
# by the compiler before setting the compile option.
 | 
			
		||||
function (upm_add_compile_flags compiler)
 | 
			
		||||
  set (_TMP_COMPILER_FLAGS "")
 | 
			
		||||
  # Iterate the flags, check if supported
 | 
			
		||||
  foreach (flag ${ARGN})
 | 
			
		||||
    # Check if this compile flag is supported
 | 
			
		||||
@@ -85,7 +86,7 @@ function (upm_add_compile_flags compiler)
 | 
			
		||||
  endforeach (flag ${ARGN})
 | 
			
		||||
 | 
			
		||||
  # Set the variable in the parent scope
 | 
			
		||||
  set (CMAKE_${compiler}_FLAGS ${_TMP_COMPILER_FLAGS} PARENT_SCOPE)
 | 
			
		||||
  set (CMAKE_${compiler}_FLAGS "${CMAKE_${compiler}_FLAGS} ${_TMP_COMPILER_FLAGS}" PARENT_SCOPE)
 | 
			
		||||
endfunction ()
 | 
			
		||||
 | 
			
		||||
# Compiler flags common to both C and CXX
 | 
			
		||||
@@ -95,7 +96,7 @@ set (C_CXX_WARNING_FLAGS -Wall -Wno-misleading-indentation)
 | 
			
		||||
 | 
			
		||||
# Warnings as errors?
 | 
			
		||||
if (WERROR)
 | 
			
		||||
  list (APPEND C_CXX_WARNING_FLAGS -Werror)
 | 
			
		||||
  set (C_CXX_WARNING_FLAGS "-Werror ${C_CXX_WARNING_FLAGS}")
 | 
			
		||||
  message (STATUS "Warnings as errors enabled (-Werror), disable with -DWERROR=off")
 | 
			
		||||
endif (WERROR)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user