From 9c342f496ade0fd6355566ee13a70192902d1f87 Mon Sep 17 00:00:00 2001 From: Laurence Kedward Date: Sun, 22 Nov 2020 14:25:42 +0000 Subject: Minor fix: explicitly specify .exe suffix in windows. --- fpm/src/fpm_targets.f90 | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/fpm/src/fpm_targets.f90 b/fpm/src/fpm_targets.f90 index c3a59fd..364e9d8 100644 --- a/fpm/src/fpm_targets.f90 +++ b/fpm/src/fpm_targets.f90 @@ -13,9 +13,16 @@ subroutine targets_from_sources(model,sources) type(srcfile_t), intent(in) :: sources(:) integer :: i + character(:), allocatable :: xsuffix type(build_target_t), pointer :: dep logical :: with_lib + if (get_os_type() == OS_WINDOWS) then + xsuffix = '.exe' + else + xsuffix = '' + end if + with_lib = any([(sources(i)%unit_scope == FPM_SCOPE_LIB,i=1,size(sources))]) if (with_lib) call add_target(model%targets,type = FPM_TARGET_ARCHIVE,& @@ -46,11 +53,13 @@ subroutine targets_from_sources(model,sources) if (sources(i)%unit_scope == FPM_SCOPE_APP) then call add_target(model%targets,type = FPM_TARGET_EXECUTABLE,& link_libraries = sources(i)%link_libraries, & - output_file = join_path(model%output_directory,'app',sources(i)%exe_name)) + output_file = join_path(model%output_directory,'app', & + sources(i)%exe_name//xsuffix)) else call add_target(model%targets,type = FPM_TARGET_EXECUTABLE,& link_libraries = sources(i)%link_libraries, & - output_file = join_path(model%output_directory,'test',sources(i)%exe_name)) + output_file = join_path(model%output_directory,'test', & + sources(i)%exe_name//xsuffix)) end if -- cgit v1.2.3