Compute a key representing the current manifest-related configuration.
This key is used to detect when changes require rebuilding the watch list.
It includes:
- Selected fpm_build_settings fields
- Feature list (settings%features)
- The fingerprint of any watched file named fpm.toml
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(fpm_build_settings), | intent(in) | :: | settings | |||
| type(string_t), | intent(in), | allocatable | :: | files(:) |
integer(int64) function manifest_key_from_files(settings, files) result(k) class(fpm_build_settings), intent(in) :: settings type(string_t), allocatable, intent(in) :: files(:) integer :: i character(len=:), allocatable :: b k = FNV_OFFSET call mix_alloc(k, settings%build_dir) call mix_alloc(k, settings%compiler) call mix_alloc(k, settings%c_compiler) call mix_alloc(k, settings%cxx_compiler) call mix_alloc(k, settings%archiver) call mix_alloc(k, settings%profile) call mix_alloc(k, settings%flag) call mix_alloc(k, settings%cflag) call mix_alloc(k, settings%cxxflag) call mix_alloc(k, settings%ldflag) if (settings%prune) then call fnv1a_mix_str(k, "prune=1") else call fnv1a_mix_str(k, "prune=0") end if if (settings%build_tests) then call fnv1a_mix_str(k, "build_tests=1") else call fnv1a_mix_str(k, "build_tests=0") end if if (allocated(settings%features)) then do i = 1, size(settings%features) call fnv1a_mix_str(k, trim(settings%features(i)%s)) end do end if if (.not. allocated(files)) return do i = 1, size(files) b = basename(files(i)%s) if (b == "fpm.toml") then call fnv1a_mix_str(k, files(i)%s) call fnv1a_mix_i64(k, file_fingerprint(files(i)%s)) end if end do contains subroutine mix_alloc(h, s) integer(int64), intent(inout) :: h character(len=:), allocatable, intent(in) :: s if (.not. allocated(s)) return if (len_trim(s) == 0) return call fnv1a_mix_str(h, trim(s)) end subroutine mix_alloc end function manifest_key_from_files