@@ -198,15 +198,14 @@ subroutine build_target_list(targets,model)
198
198
character (:), allocatable :: exe_dir, compile_flags
199
199
logical :: with_lib
200
200
201
+ ! Initialize targets
202
+ allocate (targets(0 ))
203
+
201
204
! Check for empty build (e.g. header-only lib)
202
205
n_source = sum ([(size (model% packages(j)% sources), &
203
206
j= 1 ,size (model% packages))])
204
207
205
- if (n_source < 1 ) then
206
- allocate (targets(0 ))
207
- return
208
- end if
209
-
208
+ if (n_source < 1 ) return
210
209
211
210
with_lib = any ([((model% packages(j)% sources(i)% unit_scope == FPM_SCOPE_LIB, &
212
211
i= 1 ,size (model% packages(j)% sources)), &
@@ -826,7 +825,7 @@ subroutine resolve_target_linking(targets, model)
826
825
if (.not. allocated (target % compile_flags)) allocate (character (len= 0 ) :: target % compile_flags)
827
826
828
827
target % compile_flags = target % compile_flags// ' '
829
-
828
+
830
829
select case (target % target_type)
831
830
case (FPM_TARGET_C_OBJECT)
832
831
target % compile_flags = target % compile_flags// model% c_compile_flags
@@ -835,7 +834,7 @@ subroutine resolve_target_linking(targets, model)
835
834
case default
836
835
target % compile_flags = target % compile_flags// model% fortran_compile_flags &
837
836
& // get_feature_flags(model% compiler, target % features)
838
- end select
837
+ end select
839
838
840
839
! > Get macros as flags.
841
840
target % compile_flags = target % compile_flags // get_macros(model% compiler% id, &
0 commit comments