fpm_sources Module

Discovery of sources

This module implements subroutines for building a list of srcfile_t objects by looking for source files in the filesystem.



Contents


Subroutines

public subroutine add_executable_sources(sources, executables, scope, auto_discover, error)

Add to sources using the executable and test entries in the manifest and applies any executable-specific overrides such as executable%name. Adds all sources (including modules) from each executable%source_dir

Arguments

Type IntentOptional AttributesName
type(srcfile_t), intent(inout), allocatable, target:: sources(:)

List of srcfile_t objects to append to. Allocated if not allocated

class(executable_config_t), intent(in) :: executables(:)

List of executable_config_t entries from manifest

integer, intent(in) :: scope

Scope to apply to the discovered sources: either FPM_SCOPE_APP or FPM_SCOPE_TEST, see fpm_model

logical, intent(in) :: auto_discover

If .false. only executables and tests specified in the manifest are added to sources

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

Error handling

public subroutine add_sources_from_dir(sources, directory, scope, with_executables, recurse, error)

Add to sources by looking for source files in directory

Arguments

Type IntentOptional AttributesName
type(srcfile_t), intent(inout), allocatable, target:: sources(:)

List of srcfile_t objects to append to. Allocated if not allocated

character, intent(in) :: directory

Directory in which to search for source files

integer, intent(in) :: scope

Scope to apply to the discovered sources, see fpm_model for enumeration

logical, intent(in), optional :: with_executables

Executable sources (fortran programs) are ignored unless with_executables=.true.

logical, intent(in), optional :: recurse

Whether to recursively search subdirectories, default is .true.

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

Error handling