Uses a list of [[build_target_ptr]]
and a valid [[fpm_model]]
instance
to schedule and execute the compilation and linking of package targets.
The package build process ([[build_package]]
) comprises three steps:
[[sort_target]]
)[[schedule_targets]]
)@note Note If compiled with OpenMP, targets will be build in parallel where possible.
The backend process supports incremental compilation whereby targets are not re-compiled if their corresponding dependencies have not been modified.
Source-based targets (i.e. objects) are not re-compiled if the corresponding source file is unmodified AND all of the target dependencies are not marked for re-compilation
Link targets (i.e. executables and libraries) are not re-compiled if the target output file already exists AND all of the target dependencies are not marked for re-compilation
Source file modification is determined by a file digest (hash) which is calculated during the source parsing phase (fpm_source_parsing) and cached to disk after a target is successfully generated.
Top-level routine to build package described by model
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(build_target_ptr), | intent(inout) | :: | targets(:) | |||
type(fpm_model_t), | intent(in) | :: | model | |||
logical, | intent(in) | :: | verbose |
Construct a build schedule from the sorted targets.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(build_target_ptr), | intent(out), | allocatable | :: | queue(:) | ||
integer, | allocatable | :: | schedule_ptr(:) | |||
type(build_target_ptr), | intent(in) | :: | targets(:) |
Topologically sort a target for scheduling by recursing over its dependencies.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(build_target_t), | intent(inout), | target | :: | target |