def ValidateTargetType(target, target_dict):
 VALID_TARGET_TYPES = ('executable', 'loadable_module', 'static_library', 'shared_library', 'mac_kernel_extension', 'none')
 target_type = target_dict.get('type', None)
 if (target_type not in VALID_TARGET_TYPES):
  raise GypError(("Target %s has an invalid target type '%s'.  Must be one of %s." % (target, target_type, '/'.join(VALID_TARGET_TYPES))))
 if (target_dict.get('standalone_static_library', 0) and (not (target_type == 'static_library'))):
  raise GypError(('Target %s has type %s but standalone_static_library flag is only valid for static_library type.' % (target, target_type)))

def ValidateTargetType ( target , target_dict ) : VALID_TARGET_TYPES = ( 'executable' , 'loadable_module' , 'static_library' , 'shared_library' , 'mac_kernel_extension' , 'none' ) target_type = target_dict . get ( 'type' , None ) if ( target_type not in VALID_TARGET_TYPES ) : raise GypError ( ( "Target %s has an invalid target type '%s'.  Must be one of %s." % ( target , target_type , '/' . join ( VALID_TARGET_TYPES ) ) ) ) if ( target_dict . get ( 'standalone_static_library' , 0 ) and ( not ( target_type == 'static_library' ) ) ) : raise GypError ( ( 'Target %s has type %s but standalone_static_library flag is only valid for static_library type.' % ( target , target_type ) ) )
ensures the type field on the target is one of the known types .