diff options
author | Laurence Kedward <laurence.kedward@bristol.ac.uk> | 2021-11-28 11:11:11 +0000 |
---|---|---|
committer | Laurence Kedward <laurence.kedward@bristol.ac.uk> | 2021-11-29 11:54:17 +0000 |
commit | 4556e7a4435c6ef2da8782c033229e06e91b6a4e (patch) | |
tree | f24d55adb5364948ec0733473cf56bfb5dc8daab /src | |
parent | fc058eca31036584649cd3b712a649e9dd01c2d7 (diff) | |
download | fpm-4556e7a4435c6ef2da8782c033229e06e91b6a4e.tar.gz fpm-4556e7a4435c6ef2da8782c033229e06e91b6a4e.zip |
Apply suggestion: move echo/verbosity into constructors
For compiler_t and archive_t objects
Diffstat (limited to 'src')
-rw-r--r-- | src/fpm.f90 | 11 | ||||
-rw-r--r-- | src/fpm_compiler.f90 | 19 |
2 files changed, 19 insertions, 11 deletions
diff --git a/src/fpm.f90 b/src/fpm.f90 index 8b05a38..135cadc 100644 --- a/src/fpm.f90 +++ b/src/fpm.f90 @@ -59,13 +59,10 @@ subroutine build_model(model, settings, package, error) call filewrite(join_path("build", ".gitignore"),["*"]) end if - call new_compiler(model%compiler, settings%compiler, settings%c_compiler) - call new_archiver(model%archiver, settings%archiver) - - model%compiler%verbose = settings%verbose - model%compiler%echo = settings%verbose - model%archiver%verbose = settings%verbose - model%archiver%echo = settings%verbose + call new_compiler(model%compiler, settings%compiler, settings%c_compiler, & + & echo=settings%verbose, verbose=settings%verbose) + call new_archiver(model%archiver, settings%archiver, & + & echo=settings%verbose, verbose=settings%verbose) if (settings%flag == '') then flags = model%compiler%get_default_flags(settings%profile == "release") diff --git a/src/fpm_compiler.f90 b/src/fpm_compiler.f90 index dba21b2..2f939ad 100644 --- a/src/fpm_compiler.f90 +++ b/src/fpm_compiler.f90 @@ -623,16 +623,22 @@ end function enumerate_libraries !> Create new compiler instance -subroutine new_compiler(self, fc, cc) +subroutine new_compiler(self, fc, cc, echo, verbose) !> New instance of the compiler type(compiler_t), intent(out) :: self !> Fortran compiler name or path character(len=*), intent(in) :: fc !> C compiler name or path character(len=*), intent(in) :: cc + !> Echo compiler command + logical, intent(in) :: echo + !> Verbose mode: dump compiler output + logical, intent(in) :: verbose self%id = get_compiler_id(fc) - + + self%echo = echo + self%verbose = verbose self%fc = fc if (len_trim(cc) > 0) then self%cc = cc @@ -643,11 +649,15 @@ end subroutine new_compiler !> Create new archiver instance -subroutine new_archiver(self, ar) +subroutine new_archiver(self, ar, echo, verbose) !> New instance of the archiver type(archiver_t), intent(out) :: self !> User provided archiver command character(len=*), intent(in) :: ar + !> Echo compiler command + logical, intent(in) :: echo + !> Verbose mode: dump compiler output + logical, intent(in) :: verbose integer :: estat, os_type @@ -681,7 +691,8 @@ subroutine new_archiver(self, ar) end if end if self%use_response_file = os_type == OS_WINDOWS - self%echo = .true. + self%echo = echo + self%verbose = verbose end subroutine new_archiver |