def _InitNinjaFlavor(params, target_list, target_dicts):
 for qualified_target in target_list:
  spec = target_dicts[qualified_target]
  if spec.get('msvs_external_builder'):
   continue
  path_to_ninja = spec.get('msvs_path_to_ninja', 'ninja.exe')
  spec['msvs_external_builder'] = 'ninja'
  if (not spec.get('msvs_external_builder_out_dir')):
   (gyp_file, _, _) = gyp.common.ParseQualifiedTarget(qualified_target)
   gyp_dir = os.path.dirname(gyp_file)
   configuration = '$(Configuration)'
   if (params.get('target_arch') == 'x64'):
    configuration += '_x64'
   spec['msvs_external_builder_out_dir'] = os.path.join(gyp.common.RelativePath(params['options'].toplevel_dir, gyp_dir), ninja_generator.ComputeOutputDir(params), configuration)
  if (not spec.get('msvs_external_builder_build_cmd')):
   spec['msvs_external_builder_build_cmd'] = [path_to_ninja, '-C', '$(OutDir)', '$(ProjectName)']
  if (not spec.get('msvs_external_builder_clean_cmd')):
   spec['msvs_external_builder_clean_cmd'] = [path_to_ninja, '-C', '$(OutDir)', '-tclean', '$(ProjectName)']

def _InitNinjaFlavor ( params , target_list , target_dicts ) : for qualified_target in target_list : spec = target_dicts [ qualified_target ] if spec . get ( 'msvs_external_builder' ) : continue path_to_ninja = spec . get ( 'msvs_path_to_ninja' , 'ninja.exe' ) spec [ 'msvs_external_builder' ] = 'ninja' if ( not spec . get ( 'msvs_external_builder_out_dir' ) ) : ( gyp_file , _ , _ ) = gyp . common . ParseQualifiedTarget ( qualified_target ) gyp_dir = os . path . dirname ( gyp_file ) configuration = '$(Configuration)' if ( params . get ( 'target_arch' ) == 'x64' ) : configuration += '_x64' spec [ 'msvs_external_builder_out_dir' ] = os . path . join ( gyp . common . RelativePath ( params [ 'options' ] . toplevel_dir , gyp_dir ) , ninja_generator . ComputeOutputDir ( params ) , configuration ) if ( not spec . get ( 'msvs_external_builder_build_cmd' ) ) : spec [ 'msvs_external_builder_build_cmd' ] = [ path_to_ninja , '-C' , '$(OutDir)' , '$(ProjectName)' ] if ( not spec . get ( 'msvs_external_builder_clean_cmd' ) ) : spec [ 'msvs_external_builder_clean_cmd' ] = [ path_to_ninja , '-C' , '$(OutDir)' , '-tclean' , '$(ProjectName)' ]
initialize targets for the ninja flavor .