diff options
author | LKedward <laurence.kedward@bristol.ac.uk> | 2021-04-15 19:06:03 +0100 |
---|---|---|
committer | LKedward <laurence.kedward@bristol.ac.uk> | 2021-04-15 19:06:03 +0100 |
commit | 086ae55dfa09c1924d2b54bc88ddb1827f9dcfa7 (patch) | |
tree | eeca6342f10aa2cfdf9498e71744f833512284e1 /src/fpm_environment.f90 | |
parent | 0d3611a5f3e7a2d7cb88ec8637a9d898b2ce4cfb (diff) | |
download | fpm-086ae55dfa09c1924d2b54bc88ddb1827f9dcfa7.tar.gz fpm-086ae55dfa09c1924d2b54bc88ddb1827f9dcfa7.zip |
Update: backend to fail more gracefully for compilation errors
Removes fpm backtrace and lists target(s) that failed
Diffstat (limited to 'src/fpm_environment.f90')
-rw-r--r-- | src/fpm_environment.f90 | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/fpm_environment.f90 b/src/fpm_environment.f90 index 0408ec4..982380d 100644 --- a/src/fpm_environment.f90 +++ b/src/fpm_environment.f90 @@ -125,9 +125,10 @@ contains end function os_is_unix !> echo command string and pass it to the system for execution - subroutine run(cmd,echo) + subroutine run(cmd,echo,exitstat) character(len=*), intent(in) :: cmd logical,intent(in),optional :: echo + integer, intent(out),optional :: exitstat logical :: echo_local integer :: stat @@ -139,10 +140,16 @@ contains if(echo_local) print *, '+ ', cmd call execute_command_line(cmd, exitstat=stat) - if (stat /= 0) then - print *, 'Command failed' - error stop + + if (present(exitstat)) then + exitstat = stat + else + if (stat /= 0) then + print *, 'Command failed' + error stop + end if end if + end subroutine run !> get named environment variable value. It it is blank or |