@FeatureNewKwargs('build_target', '0.40.0', ['link_whole', 'override_options'])
@permittedKwargs(permitted_kwargs['build_target'])
def func_build_target(self, node, args, kwargs):
    if ('target_type' not in kwargs):
        raise InterpreterException('Missing target_type keyword argument')
    target_type = kwargs.pop('target_type')
    if (target_type == 'executable'):
        return self.build_target(node, args, kwargs, ExecutableHolder)
    elif (target_type == 'shared_library'):
        return self.build_target(node, args, kwargs, SharedLibraryHolder)
    elif (target_type == 'shared_module'):
        FeatureNew("build_target(target_type: 'shared_module')", '0.51.0').use(self.subproject)
        return self.build_target(node, args, kwargs, SharedModuleHolder)
    elif (target_type == 'static_library'):
        return self.build_target(node, args, kwargs, StaticLibraryHolder)
    elif (target_type == 'both_libraries'):
        return self.build_both_libraries(node, args, kwargs)
    elif (target_type == 'library'):
        return self.build_library(node, args, kwargs)
    elif (target_type == 'jar'):
        return self.build_target(node, args, kwargs, JarHolder)
    else:
        raise InterpreterException('Unknown target_type.')
@FeatureNewKwargs('build_target', '0.40.0', ['link_whole', 'override_options'])
@permittedKwargs(permitted_kwargs['build_target'])
def func_build_target(self, node, args, kwargs):
    if ('target_type' not in kwargs):
        raise InterpreterException('Missing target_type keyword argument')
    target_type = kwargs.pop('target_type')
    if (target_type == 'executable'):
        return self.build_target(node, args, kwargs, ExecutableHolder)
    elif (target_type == 'shared_library'):
        return self.build_target(node, args, kwargs, SharedLibraryHolder)
    elif (target_type == 'shared_module'):
        FeatureNew("build_target(target_type: 'shared_module')", '0.51.0').use(self.subproject)
        return self.build_target(node, args, kwargs, SharedModuleHolder)
    elif (target_type == 'static_library'):
        return self.build_target(node, args, kwargs, StaticLibraryHolder)
    elif (target_type == 'both_libraries'):
        return self.build_both_libraries(node, args, kwargs)
    elif (target_type == 'library'):
        return self.build_library(node, args, kwargs)
    elif (target_type == 'jar'):
        return self.build_target(node, args, kwargs, JarHolder)
    else:
        raise InterpreterException('Unknown target_type.')