Skip to content

Commit 8c5763b

Browse files
committed
Allow specifying C compiler with environment variable
FPM_C_COMPILER
1 parent 836a652 commit 8c5763b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/fpm.f90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module fpm
44
use fpm_command_line, only: fpm_build_settings, fpm_new_settings, &
55
fpm_run_settings, fpm_install_settings, fpm_test_settings
66
use fpm_dependency, only : new_dependency_tree
7-
use fpm_environment, only: run
7+
use fpm_environment, only: run, get_env
88
use fpm_filesystem, only: is_dir, join_path, number_of_rows, list_files, exists, basename
99
use fpm_model, only: fpm_model_t, srcfile_t, show_model, &
1010
FPM_SCOPE_UNKNOWN, FPM_SCOPE_LIB, FPM_SCOPE_DEP, &
@@ -63,6 +63,7 @@ subroutine build_model(model, settings, package, error)
6363
endif
6464

6565
call get_default_c_compiler(model%fortran_compiler, model%c_compiler)
66+
model%c_compiler = get_env('FPM_C_COMPILER',model%c_compiler)
6667

6768
if (is_unknown_compiler(model%fortran_compiler)) then
6869
write(*, '(*(a:,1x))') &

0 commit comments

Comments
 (0)