aboutsummaryrefslogtreecommitdiff
path: root/src/fpm.f90
diff options
context:
space:
mode:
authorLKedward <laurence.kedward@bristol.ac.uk>2021-04-08 15:27:07 +0100
committerLaurence Kedward <laurence.kedward@bristol.ac.uk>2021-04-09 14:45:28 +0100
commitc957b27d275ebd575b5d49599c14e7252765f3ce (patch)
tree5521db39bd1ea60963b26d012cffee030372a8a8 /src/fpm.f90
parentf28ac3e31cb0e5c558a4fdb4ce5f461ce1c83ea4 (diff)
downloadfpm-c957b27d275ebd575b5d49599c14e7252765f3ce.tar.gz
fpm-c957b27d275ebd575b5d49599c14e7252765f3ce.zip
Select c compiler based on fortran compiler id
Diffstat (limited to 'src/fpm.f90')
-rw-r--r--src/fpm.f905
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fpm.f90 b/src/fpm.f90
index 31b68ff..653f8be 100644
--- a/src/fpm.f90
+++ b/src/fpm.f90
@@ -9,7 +9,7 @@ use fpm_filesystem, only: is_dir, join_path, number_of_rows, list_files, exists,
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
+use fpm_compiler, only: get_module_flags, is_unknown_compiler, get_default_c_compiler
use fpm_sources, only: add_executable_sources, add_sources_from_dir
@@ -62,6 +62,8 @@ subroutine build_model(model, settings, package, error)
model%fortran_compiler = settings%compiler
endif
+ call get_default_c_compiler(model%fortran_compiler, model%c_compiler)
+
if (is_unknown_compiler(model%fortran_compiler)) then
write(*, '(*(a:,1x))') &
"<WARN>", "Unknown compiler", model%fortran_compiler, "requested!", &
@@ -178,6 +180,7 @@ 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 OPTIONS: ', model%fortran_compile_flags
write(*,*)'<INFO> INCLUDE DIRECTORIES: [', string_cat(model%include_dirs,','),']'
end if