targets_from_sources Subroutine

public subroutine targets_from_sources(targets, model, prune, error)

High-level wrapper to generate build target information

Arguments

Type IntentOptional Attributes Name
type(build_target_ptr), intent(out), allocatable :: targets(:)

The generated list of build targets

type(fpm_model_t), intent(inout), target :: model

The package model from which to construct the target list

logical, intent(in) :: prune

Enable tree-shaking/pruning of module dependencies

type(error_t), intent(out), allocatable :: error

Error structure


Source Code

subroutine targets_from_sources(targets,model,prune,error)

    !> The generated list of build targets
    type(build_target_ptr), intent(out), allocatable :: targets(:)

    !> The package model from which to construct the target list
    type(fpm_model_t), intent(inout), target :: model

    !> Enable tree-shaking/pruning of module dependencies
    logical, intent(in) :: prune

    !> Error structure
    type(error_t), intent(out), allocatable :: error

    call build_target_list(targets,model)

    call collect_exe_link_dependencies(targets)

    call resolve_module_dependencies(targets,model%external_modules,error)
    if (allocated(error)) return

    if (prune) then
        call prune_build_targets(targets,root_package=model%package_name)
    end if

    call resolve_target_linking(targets,model)

end subroutine targets_from_sources