aboutsummaryrefslogtreecommitdiff
path: root/src/fpm.f90
diff options
context:
space:
mode:
authorSebastian Ehlert <28669218+awvwgk@users.noreply.github.com>2021-07-30 18:25:46 +0200
committerSebastian Ehlert <28669218+awvwgk@users.noreply.github.com>2021-07-30 18:25:46 +0200
commit5d22f5aac698c4b8f135a226e944be9ded9475b0 (patch)
tree15f135fc25968cf4c8f3369c9fb3b77792e65630 /src/fpm.f90
parent8ffe495e6097358e98cf45464cdc45b58a31e0fb (diff)
downloadfpm-5d22f5aac698c4b8f135a226e944be9ded9475b0.tar.gz
fpm-5d22f5aac698c4b8f135a226e944be9ded9475b0.zip
Add objects for handling compiler and archiver
Diffstat (limited to 'src/fpm.f90')
-rw-r--r--src/fpm.f9024
1 files changed, 12 insertions, 12 deletions
diff --git a/src/fpm.f90 b/src/fpm.f90
index 89eca1a..465d16e 100644
--- a/src/fpm.f90
+++ b/src/fpm.f90
@@ -10,7 +10,7 @@ use fpm_model, only: fpm_model_t, srcfile_t, show_model, &
FPM_SCOPE_UNKNOWN, FPM_SCOPE_LIB, FPM_SCOPE_DEP, &
FPM_SCOPE_APP, FPM_SCOPE_EXAMPLE, FPM_SCOPE_TEST
use fpm_compiler, only: get_module_flags, is_unknown_compiler, get_default_c_compiler, &
- get_archiver
+ archiver_t
use fpm_sources, only: add_executable_sources, add_sources_from_dir
@@ -59,23 +59,23 @@ subroutine build_model(model, settings, package, error)
if (allocated(error)) return
if(settings%compiler.eq.'')then
- model%fortran_compiler = 'gfortran'
+ model%compiler%fc = "gfortran"
else
- model%fortran_compiler = settings%compiler
+ model%compiler%fc = settings%compiler
endif
- model%archiver = get_archiver()
- call get_default_c_compiler(model%fortran_compiler, model%c_compiler)
- model%c_compiler = get_env('FPM_C_COMPILER',model%c_compiler)
+ model%archiver = archiver_t()
+ call get_default_c_compiler(model%compiler%fc, model%compiler%cc)
+ model%compiler%cc = get_env('FPM_C_COMPILER',model%compiler%cc)
- if (is_unknown_compiler(model%fortran_compiler)) then
+ if (is_unknown_compiler(model%compiler%fc)) then
write(*, '(*(a:,1x))') &
- "<WARN>", "Unknown compiler", model%fortran_compiler, "requested!", &
+ "<WARN>", "Unknown compiler", model%compiler%fc, "requested!", &
"Defaults for this compiler might be incorrect"
end if
- model%output_directory = join_path('build',basename(model%fortran_compiler)//'_'//settings%build_name)
+ model%output_directory = join_path('build',basename(model%compiler%fc)//'_'//settings%build_name)
- call get_module_flags(model%fortran_compiler, &
+ call get_module_flags(model%compiler%fc, &
& join_path(model%output_directory,model%package_name), &
& model%fortran_compile_flags)
model%fortran_compile_flags = settings%flag // model%fortran_compile_flags
@@ -187,8 +187,8 @@ subroutine build_model(model, settings, package, error)
if (settings%verbose) then
write(*,*)'<INFO> BUILD_NAME: ',settings%build_name
- write(*,*)'<INFO> COMPILER: ',settings%compiler
- write(*,*)'<INFO> C COMPILER: ',model%c_compiler
+ write(*,*)'<INFO> COMPILER: ',model%compiler%fc
+ write(*,*)'<INFO> C COMPILER: ',model%compiler%cc
write(*,*)'<INFO> COMPILER OPTIONS: ', model%fortran_compile_flags
write(*,*)'<INFO> INCLUDE DIRECTORIES: [', string_cat(model%include_dirs,','),']'
end if