diff options
author | Laurence Kedward <laurence.kedward@bristol.ac.uk> | 2021-04-17 17:18:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-17 17:18:50 +0100 |
commit | fbbfb2c1c316674a83acd666754a3fd18b643d84 (patch) | |
tree | fc38bd0d71a615dac4e847e891771b292cfb1e75 /src/fpm.f90 | |
parent | 4cbf9194e47991a208cd61b1f3a0a55f0ae16573 (diff) | |
parent | 079e7da06181a6dc9cee6f8f3b1b1c4ebde9e573 (diff) | |
download | fpm-fbbfb2c1c316674a83acd666754a3fd18b643d84.tar.gz fpm-fbbfb2c1c316674a83acd666754a3fd18b643d84.zip |
Merge pull request #433 from LKedward/intel-c
Fix to allow compiling C with Intel CC
Diffstat (limited to 'src/fpm.f90')
-rw-r--r-- | src/fpm.f90 | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/fpm.f90 b/src/fpm.f90 index a62ffe0..5e86498 100644 --- a/src/fpm.f90 +++ b/src/fpm.f90 @@ -4,12 +4,12 @@ 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: run +use fpm_environment, only: run, get_env 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, & 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 @@ -63,6 +63,9 @@ subroutine build_model(model, settings, package, error) model%fortran_compiler = settings%compiler endif + call get_default_c_compiler(model%fortran_compiler, model%c_compiler) + model%c_compiler = get_env('FPM_C_COMPILER',model%c_compiler) + if (is_unknown_compiler(model%fortran_compiler)) then write(*, '(*(a:,1x))') & "<WARN>", "Unknown compiler", model%fortran_compiler, "requested!", & @@ -183,6 +186,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 |