Type describing everything required to build the root package and its dependencies.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(archiver_t), | public | :: | archiver |
Archiver object |
|||
character(len=:), | public, | allocatable | :: | build_prefix |
Base directory for build |
||
character(len=:), | public, | allocatable | :: | c_compile_flags |
Command line flags passed to C for compilation |
||
type(compiler_t), | public | :: | compiler |
Compiler object |
|||
character(len=:), | public, | allocatable | :: | cxx_compile_flags |
Command line flags passed to C++ for compilation |
||
type(dependency_tree_t), | public | :: | deps |
Project dependencies |
|||
logical, | public | :: | enforce_module_names | = | .false. |
Whether module names should be prefixed with the package name |
|
type(string_t), | public, | allocatable | :: | external_modules(:) |
External modules used |
||
character(len=:), | public, | allocatable | :: | fortran_compile_flags |
Command line flags passed to fortran for compilation |
||
type(string_t), | public, | allocatable | :: | include_dirs(:) |
Include directories |
||
logical, | public | :: | include_tests | = | .true. |
Whether tests should be added to the build list |
|
character(len=:), | public, | allocatable | :: | link_flags |
Command line flags passed to the linker |
||
type(string_t), | public, | allocatable | :: | link_libraries(:) |
Native libraries to link against |
||
type(string_t), | public | :: | module_prefix |
Prefix for all module names |
|||
character(len=:), | public, | allocatable | :: | package_name |
Name of root package |
||
type(package_t), | public, | allocatable | :: | packages(:) |
Array of packages (including the root package) |
Dump dependency to toml table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(srcfile_t), | intent(inout) | :: | self |
Instance of the serializable object |
||
type(toml_table), | intent(inout) | :: | table |
Data structure |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
Write serializable object to file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(serializable_t), | intent(inout) | :: | self |
Instance of the dependency tree |
||
character(len=*), | intent(in) | :: | file |
File name |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
|
logical, | intent(in), | optional | :: | json |
Optional JSON format |
Write serializable object to a formatted Fortran unit
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(serializable_t), | intent(inout) | :: | self |
Instance of the dependency tree |
||
integer, | intent(in) | :: | unit |
Formatted unit |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
|
logical, | intent(in), | optional | :: | json |
Optional JSON format requested? |
Dump dependency to toml table
Array of packages (including the root package)
Because dependencies are named, fallback if this has no name So, serialization will work regardless of size(self%dep) == self%ndep
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fpm_model_t), | intent(inout) | :: | self |
Instance of the serializable object |
||
type(toml_table), | intent(inout) | :: | table |
Data structure |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
Read dependency from toml table (no checks made at this stage)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(srcfile_t), | intent(inout) | :: | self |
Instance of the serializable object |
||
type(toml_table), | intent(inout) | :: | table |
Data structure |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
Read dependency tree from file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(serializable_t), | intent(inout) | :: | self |
Instance of the dependency tree |
||
character(len=*), | intent(in) | :: | file |
File name |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
|
logical, | intent(in), | optional | :: | json |
Optional JSON format |
Read dependency tree from file init JSON interpreter Read object from TOML table
use default TOML parser
Read object from TOML table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(serializable_t), | intent(inout) | :: | self |
Instance of the dependency tree |
||
integer, | intent(in) | :: | unit |
File name |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
|
logical, | intent(in), | optional | :: | json |
Optional JSON format |
Read dependency from toml table (no checks made at this stage)
Read all packages
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fpm_model_t), | intent(inout) | :: | self |
Instance of the serializable object |
||
type(toml_table), | intent(inout) | :: | table |
Data structure |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
Check that two source files are equal All checks passed!
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(srcfile_t), | intent(in) | :: | this | |||
class(serializable_t), | intent(in) | :: | that |
Serialization interface
Check that two model objects are equal All checks passed!
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(fpm_model_t), | intent(in) | :: | this | |||
class(serializable_t), | intent(in) | :: | that |
Test load/write roundtrip
Test serialization of a serializable object Dump to scratch file Load from scratch file Check same
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(serializable_t), | intent(inout) | :: | self | |||
character(len=*), | intent(in) | :: | message | |||
type(error_t), | intent(out), | allocatable | :: | error |
type, extends(serializable_t) :: fpm_model_t !> Name of root package character(:), allocatable :: package_name !> Array of packages (including the root package) type(package_t), allocatable :: packages(:) !> Compiler object type(compiler_t) :: compiler !> Archiver object type(archiver_t) :: archiver !> Command line flags passed to fortran for compilation character(:), allocatable :: fortran_compile_flags !> Command line flags passed to C for compilation character(:), allocatable :: c_compile_flags !> Command line flags passed to C++ for compilation character(:), allocatable :: cxx_compile_flags !> Command line flags passed to the linker character(:), allocatable :: link_flags !> Base directory for build character(:), allocatable :: build_prefix !> Include directories type(string_t), allocatable :: include_dirs(:) !> Native libraries to link against type(string_t), allocatable :: link_libraries(:) !> External modules used type(string_t), allocatable :: external_modules(:) !> Project dependencies type(dependency_tree_t) :: deps !> Whether tests should be added to the build list logical :: include_tests = .true. !> Whether module names should be prefixed with the package name logical :: enforce_module_names = .false. !> Prefix for all module names type(string_t) :: module_prefix contains !> Serialization interface procedure :: serializable_is_same => model_is_same procedure :: dump_to_toml => model_dump_to_toml procedure :: load_from_toml => model_load_from_toml end type fpm_model_t