@@ -13,9 +13,16 @@ subroutine targets_from_sources(model,sources)
13
13
type (srcfile_t), intent (in ) :: sources(:)
14
14
15
15
integer :: i
16
+ character (:), allocatable :: xsuffix
16
17
type (build_target_t), pointer :: dep
17
18
logical :: with_lib
18
19
20
+ if (get_os_type() == OS_WINDOWS) then
21
+ xsuffix = ' .exe'
22
+ else
23
+ xsuffix = ' '
24
+ end if
25
+
19
26
with_lib = any ([(sources(i)% unit_scope == FPM_SCOPE_LIB,i= 1 ,size (sources))])
20
27
21
28
if (with_lib) call add_target(model% targets,type = FPM_TARGET_ARCHIVE,&
@@ -46,11 +53,13 @@ subroutine targets_from_sources(model,sources)
46
53
if (sources(i)% unit_scope == FPM_SCOPE_APP) then
47
54
call add_target(model% targets,type = FPM_TARGET_EXECUTABLE,&
48
55
link_libraries = sources(i)% link_libraries, &
49
- output_file = join_path(model% output_directory,' app' ,sources(i)% exe_name))
56
+ output_file = join_path(model% output_directory,' app' , &
57
+ sources(i)% exe_name// xsuffix))
50
58
else
51
59
call add_target(model% targets,type = FPM_TARGET_EXECUTABLE,&
52
60
link_libraries = sources(i)% link_libraries, &
53
- output_file = join_path(model% output_directory,' test' ,sources(i)% exe_name))
61
+ output_file = join_path(model% output_directory,' test' , &
62
+ sources(i)% exe_name// xsuffix))
54
63
55
64
end if
56
65
0 commit comments