parameters: (self, spec, configs)
docstring: Write out the flags and include paths used to compile source files for
      the current target.
  
      Args:
        spec, configs: input from gyp.
docstring_summary: Write out the flags and include paths used to compile source files for
      the current target.
docstring_tokens: Write out the flags and include paths used to compile source files for the current target .
function: def WriteSourceFlags(self, spec, configs):
      """Write out the flags and include paths used to compile source files for
      the current target.
  
      Args:
        spec, configs: input from gyp.
      """
      config = configs[spec['default_configuration']]
      extracted_includes = []
  
      self.WriteLn('\n# Flags passed to both C and C++ files.')
      cflags, includes_from_cflags = self.ExtractIncludesFromCFlags(
          config.get('cflags'))
      extracted_includes.extend(includes_from_cflags)
      self.WriteList(cflags, 'MY_CFLAGS')
  
      cflags_c, includes_from_cflags_c = self.ExtractIncludesFromCFlags(
          config.get('cflags_c'))
      extracted_includes.extend(includes_from_cflags_c)
      self.WriteList(cflags_c, 'MY_CFLAGS_C')
  
      self.WriteList(config.get('defines'), 'MY_DEFS', prefix='-D',
                     quoter=make.EscapeCppDefine)
      self.WriteLn('LOCAL_CFLAGS := $(MY_CFLAGS_C) $(MY_CFLAGS) $(MY_DEFS)')
  
      # Undefine ANDROID for host modules
      # TODO: the source code should not use macro ANDROID to tell if it's host or
      # target module.
      if self.toolset == 'host':
        self.WriteLn('# Undefine ANDROID for host modules')
        self.WriteLn('LOCAL_CFLAGS += -UANDROID')
  
      self.WriteLn('\n# Include paths placed before CFLAGS/CPPFLAGS')
      includes = list(config.get('include_dirs', []))
      includes.extend(extracted_includes)
      includes = map(Sourceify, map(self.LocalPathify, includes))
      includes = self.NormalizeIncludePaths(includes)
      self.WriteList(includes, 'LOCAL_C_INCLUDES')
      self.WriteLn('LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) '
                                       '$(LOCAL_C_INCLUDES)')
  
      self.WriteLn('\n# Flags passed to only C++ (and not C) files.')
      self.WriteList(config.get('cflags_cc'), 'LOCAL_CPPFLAGS')
function_tokens: def WriteSourceFlags ( self , spec , configs ) : config = configs [ spec [ 'default_configuration' ] ] extracted_includes = [ ] self . WriteLn ( '\n# Flags passed to both C and C++ files.' ) cflags , includes_from_cflags = self . ExtractIncludesFromCFlags ( config . get ( 'cflags' ) ) extracted_includes . extend ( includes_from_cflags ) self . WriteList ( cflags , 'MY_CFLAGS' ) cflags_c , includes_from_cflags_c = self . ExtractIncludesFromCFlags ( config . get ( 'cflags_c' ) ) extracted_includes . extend ( includes_from_cflags_c ) self . WriteList ( cflags_c , 'MY_CFLAGS_C' ) self . WriteList ( config . get ( 'defines' ) , 'MY_DEFS' , prefix = '-D' , quoter = make . EscapeCppDefine ) self . WriteLn ( 'LOCAL_CFLAGS := $(MY_CFLAGS_C) $(MY_CFLAGS) $(MY_DEFS)' ) # Undefine ANDROID for host modules # TODO: the source code should not use macro ANDROID to tell if it's host or # target module. if self . toolset == 'host' : self . WriteLn ( '# Undefine ANDROID for host modules' ) self . WriteLn ( 'LOCAL_CFLAGS += -UANDROID' ) self . WriteLn ( '\n# Include paths placed before CFLAGS/CPPFLAGS' ) includes = list ( config . get ( 'include_dirs' , [ ] ) ) includes . extend ( extracted_includes ) includes = map ( Sourceify , map ( self . LocalPathify , includes ) ) includes = self . NormalizeIncludePaths ( includes ) self . WriteList ( includes , 'LOCAL_C_INCLUDES' ) self . WriteLn ( 'LOCAL_C_INCLUDES := $(GYP_COPIED_SOURCE_ORIGIN_DIRS) ' '$(LOCAL_C_INCLUDES)' ) self . WriteLn ( '\n# Flags passed to only C++ (and not C) files.' ) self . WriteList ( config . get ( 'cflags_cc' ) , 'LOCAL_CPPFLAGS' )