code: def check_build_for_current_platform_only(self, targets):
      
      if not self._any_targets_have_native_sources(targets):
        return False
  
      targets_by_platform = pex_build_util.targets_by_platform(targets, self._python_setup)
      platforms_with_sources = self._get_targets_by_declared_platform_with_placeholders(targets_by_platform)
      platform_names = list(platforms_with_sources.keys())
  
      if len(platform_names) < 1:
        raise self.PythonNativeCodeError(
          "Error: there should be at least one platform in the target closure, because "
          "we checked that there are native sources.")
  
      if platform_names == ['current']:
        return True
  
      raise IncompatiblePlatformsError(
        'The target set contains one or more targets that depend on '
        'native code. Please ensure that the platform arguments in all relevant targets and build '
        'options are compatible with the current platform. Found targets for platforms: {}'
        .format(str(platforms_with_sources)))
docs: Performs a check of whether the current target closure has native sources and if so, ensures
      that Pants is only targeting the current platform.
  
      :param tgts: a list of :class:`Target` objects.
      :return: a boolean value indicating whether the current target closure has native sources.
      :raises: :class:`pants.base.exceptions.IncompatiblePlatformsError`