diff options
author | Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com> | 2022-01-10 08:13:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-10 08:13:42 +0100 |
commit | 64ce7b9da5826b3b728d470ae11994c23e234440 (patch) | |
tree | 22b9b0c87c4455d2deb47b7f90f4d1d400be441a /src/fpm_sources.f90 | |
parent | 32401f1fa1ed9d42e6a59d988a03fdf6f3fc9716 (diff) | |
download | fpm-64ce7b9da5826b3b728d470ae11994c23e234440.tar.gz fpm-64ce7b9da5826b3b728d470ae11994c23e234440.zip |
Respect user provided main-files (#646)
- add example package for C-main
Diffstat (limited to 'src/fpm_sources.f90')
-rw-r--r-- | src/fpm_sources.f90 | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/fpm_sources.f90 b/src/fpm_sources.f90 index f349a0e..af2870f 100644 --- a/src/fpm_sources.f90 +++ b/src/fpm_sources.f90 @@ -163,6 +163,7 @@ subroutine add_executable_sources(sources,executables,scope,auto_discover,error) if (allocated(executables(i)%link)) then sources(j)%link_libraries = executables(i)%link end if + sources(j)%unit_type = FPM_UNIT_PROGRAM cycle exe_loop end if @@ -170,12 +171,15 @@ subroutine add_executable_sources(sources,executables,scope,auto_discover,error) end do ! Add if not already discovered (auto_discovery off) - exe_source = parse_source(join_path(executables(i)%source_dir,executables(i)%main),error) - exe_source%exe_name = executables(i)%name - if (allocated(executables(i)%link)) then - exe_source%link_libraries = executables(i)%link - end if - exe_source%unit_scope = scope + associate(exe => executables(i)) + exe_source = parse_source(join_path(exe%source_dir,exe%main),error) + exe_source%exe_name = exe%name + if (allocated(exe%link)) then + exe_source%link_libraries = exe%link + end if + exe_source%unit_type = FPM_UNIT_PROGRAM + exe_source%unit_scope = scope + end associate if (allocated(error)) return |