From d314aed051dbc83f1a5ce8dce39b3b70f552509d Mon Sep 17 00:00:00 2001 From: Carlos Une Date: Sat, 16 Oct 2021 12:54:19 -0300 Subject: Change link command on Windows with `ifort` or `ifx` (#590) * Check whether compiler is `ifort` or `ifx` on Windows * Linker command with ifort/ifx on Windows * Enumerate libraries, based on compiler and platform --- src/fpm_compiler.f90 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/fpm_compiler.f90') diff --git a/src/fpm_compiler.f90 b/src/fpm_compiler.f90 index 4b9fb85..e3c4719 100644 --- a/src/fpm_compiler.f90 +++ b/src/fpm_compiler.f90 @@ -94,6 +94,8 @@ contains procedure :: link !> Check whether compiler is recognized procedure :: is_unknown + !> Enumerate libraries, based on compiler and platform + procedure :: enumerate_libraries end type compiler_t @@ -593,6 +595,23 @@ pure function is_unknown(self) is_unknown = self%id == id_unknown end function is_unknown +!> +!> Enumerate libraries, based on compiler and platform +!> +function enumerate_libraries(self, prefix, libs) result(r) + class(compiler_t), intent(in) :: self + character(len=*), intent(in) :: prefix + type(string_t), intent(in) :: libs(:) + character(len=:), allocatable :: r + + if (self%id == id_intel_classic_windows .or. & + self%id == id_intel_llvm_windows) then + r = prefix // " " // string_cat(libs,".lib ")//".lib" + else + r = prefix // " -l" // string_cat(libs," -l") + end if +end function enumerate_libraries + !> Create new compiler instance subroutine new_compiler(self, fc, cc) -- cgit v1.2.3