def build_target(self, node, args, kwargs, targetholder):

    @FeatureNewKwargs('build target', '0.42.0', ['rust_crate_type', 'build_rpath', 'implicit_include_directories'])
    @FeatureNewKwargs('build target', '0.41.0', ['rust_args'])
    @FeatureNewKwargs('build target', '0.40.0', ['build_by_default'])
    @FeatureNewKwargs('build target', '0.48.0', ['gnu_symbol_visibility'])
    def build_target_decorator_caller(self, node, args, kwargs):
        return True
    build_target_decorator_caller(self, node, args, kwargs)
    if (not args):
        raise InterpreterException('Target does not have a name.')
    (name, *sources) = args
    for_machine = self.machine_from_native_kwarg(kwargs)
    if ('sources' in kwargs):
        sources += listify(kwargs['sources'])
    sources = self.source_strings_to_files(sources)
    objs = extract_as_list(kwargs, 'objects')
    kwargs['dependencies'] = extract_as_list(kwargs, 'dependencies')
    kwargs['install_mode'] = self._get_kwarg_install_mode(kwargs)
    if ('extra_files' in kwargs):
        ef = extract_as_list(kwargs, 'extra_files')
        kwargs['extra_files'] = self.source_strings_to_files(ef)
    self.check_sources_exist(os.path.join(self.source_root, self.subdir), sources)
    if (targetholder == ExecutableHolder):
        targetclass = build.Executable
    elif (targetholder == SharedLibraryHolder):
        targetclass = build.SharedLibrary
    elif (targetholder == SharedModuleHolder):
        targetclass = build.SharedModule
    elif (targetholder == StaticLibraryHolder):
        targetclass = build.StaticLibrary
    elif (targetholder == JarHolder):
        targetclass = build.Jar
    else:
        mlog.debug('Unknown target type:', str(targetholder))
        raise RuntimeError('Unreachable code')
    self.kwarg_strings_to_includedirs(kwargs)
    kwargs = {k: v for (k, v) in kwargs.items() if (k in targetclass.known_kwargs)}
    kwargs['include_directories'] = self.extract_incdirs(kwargs)
    target = targetclass(name, self.subdir, self.subproject, for_machine, sources, objs, self.environment, kwargs)
    target.project_version = self.project_version
    if (not self.environment.machines.matches_build_machine(for_machine)):
        self.add_cross_stdlib_info(target)
    l = targetholder(target, self)
    self.add_target(name, l.held_object)
    self.project_args_frozen = True
    return l
def build_target(self, node, args, kwargs, targetholder):

    @FeatureNewKwargs('build target', '0.42.0', ['rust_crate_type', 'build_rpath', 'implicit_include_directories'])
    @FeatureNewKwargs('build target', '0.41.0', ['rust_args'])
    @FeatureNewKwargs('build target', '0.40.0', ['build_by_default'])
    @FeatureNewKwargs('build target', '0.48.0', ['gnu_symbol_visibility'])
    def build_target_decorator_caller(self, node, args, kwargs):
        return True
    build_target_decorator_caller(self, node, args, kwargs)
    if (not args):
        raise InterpreterException('Target does not have a name.')
    (name, *sources) = args
    for_machine = self.machine_from_native_kwarg(kwargs)
    if ('sources' in kwargs):
        sources += listify(kwargs['sources'])
    sources = self.source_strings_to_files(sources)
    objs = extract_as_list(kwargs, 'objects')
    kwargs['dependencies'] = extract_as_list(kwargs, 'dependencies')
    kwargs['install_mode'] = self._get_kwarg_install_mode(kwargs)
    if ('extra_files' in kwargs):
        ef = extract_as_list(kwargs, 'extra_files')
        kwargs['extra_files'] = self.source_strings_to_files(ef)
    self.check_sources_exist(os.path.join(self.source_root, self.subdir), sources)
    if (targetholder == ExecutableHolder):
        targetclass = build.Executable
    elif (targetholder == SharedLibraryHolder):
        targetclass = build.SharedLibrary
    elif (targetholder == SharedModuleHolder):
        targetclass = build.SharedModule
    elif (targetholder == StaticLibraryHolder):
        targetclass = build.StaticLibrary
    elif (targetholder == JarHolder):
        targetclass = build.Jar
    else:
        mlog.debug('Unknown target type:', str(targetholder))
        raise RuntimeError('Unreachable code')
    self.kwarg_strings_to_includedirs(kwargs)
    kwargs = {k: v for (k, v) in kwargs.items() if (k in targetclass.known_kwargs)}
    kwargs['include_directories'] = self.extract_incdirs(kwargs)
    target = targetclass(name, self.subdir, self.subproject, for_machine, sources, objs, self.environment, kwargs)
    target.project_version = self.project_version
    if (not self.environment.machines.matches_build_machine(for_machine)):
        self.add_cross_stdlib_info(target)
    l = targetholder(target, self)
    self.add_target(name, l.held_object)
    self.project_args_frozen = True
    return l