diff options
author | Laurence Kedward <laurence.kedward@bristol.ac.uk> | 2020-11-22 14:25:42 +0000 |
---|---|---|
committer | Laurence Kedward <laurence.kedward@bristol.ac.uk> | 2020-11-22 14:25:42 +0000 |
commit | 9c342f496ade0fd6355566ee13a70192902d1f87 (patch) | |
tree | fea59e57e80ae4ed2abf838d9767d697a7c26f48 | |
parent | 0d387fc7077070bb7ccbc54658a27d9db361688c (diff) | |
download | fpm-9c342f496ade0fd6355566ee13a70192902d1f87.tar.gz fpm-9c342f496ade0fd6355566ee13a70192902d1f87.zip |
Minor fix: explicitly specify .exe suffix in windows.
-rw-r--r-- | fpm/src/fpm_targets.f90 | 13 |
1 files 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 |