diff options
author | Brad Richardson <everythingfunctional@protonmail.com> | 2021-04-19 19:19:24 -0500 |
---|---|---|
committer | Brad Richardson <everythingfunctional@protonmail.com> | 2021-04-19 19:19:24 -0500 |
commit | faced2359ff7bf1c003aaf3990d006fde1124186 (patch) | |
tree | 306911e067d31e3a0348adbb7f7d658503451808 /src/fpm.f90 | |
parent | 0ac5f5bef94c8f12caa64f19fe6cb5026a5535c0 (diff) | |
download | fpm-faced2359ff7bf1c003aaf3990d006fde1124186.tar.gz fpm-faced2359ff7bf1c003aaf3990d006fde1124186.zip |
refactor(get_archiver): extract to it's own function
Diffstat (limited to 'src/fpm.f90')
-rw-r--r-- | src/fpm.f90 | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/fpm.f90 b/src/fpm.f90 index 3e2b518..fa2087d 100644 --- a/src/fpm.f90 +++ b/src/fpm.f90 @@ -4,7 +4,7 @@ use fpm_backend, only: build_package use fpm_command_line, only: fpm_build_settings, fpm_new_settings, & fpm_run_settings, fpm_install_settings, fpm_test_settings use fpm_dependency, only : new_dependency_tree -use fpm_environment, only: get_os_type, run, OS_UNKNOWN, OS_WINDOWS +use fpm_environment, only: get_archiver, run use fpm_filesystem, only: is_dir, join_path, number_of_rows, list_files, exists, basename use fpm_model, only: fpm_model_t, srcfile_t, show_model, & FPM_SCOPE_UNKNOWN, FPM_SCOPE_LIB, FPM_SCOPE_DEP, & @@ -62,22 +62,7 @@ subroutine build_model(model, settings, package, error) model%fortran_compiler = settings%compiler endif - associate(os_type => get_os_type()) - if (os_type /= OS_WINDOWS .and. os_type /= OS_UNKNOWN) then - model%archiver = "ar -rs " - else - block - integer :: estat - - call execute_command_line("ar --version", exitstat=estat) - if (estat /= 0) then - model%archiver = "lib /OUT:" - else - model%archiver = "ar -rs " - end if - end block - end if - end associate + model%archiver = get_archiver() if (is_unknown_compiler(model%fortran_compiler)) then write(*, '(*(a:,1x))') & |