diff options
-rw-r--r-- | fpm/src/fpm.f90 | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/fpm/src/fpm.f90 b/fpm/src/fpm.f90 index 9603717..c1bf54a 100644 --- a/fpm/src/fpm.f90 +++ b/fpm/src/fpm.f90 @@ -141,10 +141,20 @@ else end if end function +subroutine package_name(name) +character(:), allocatable, intent(out) :: name +! Currrently a heuristic. We should update this to read the name from fpm.toml +if (exists("src/fpm.f90")) then + name = "fpm" +else + name = "hello_world" +end if +end subroutine + subroutine cmd_build() logical :: src type(string_t), allocatable :: files(:) -character(:), allocatable :: basename +character(:), allocatable :: basename, pkg_name integer :: i, n print *, "# Building project" call list_files("src", files) @@ -156,6 +166,7 @@ do i = 1, size(files) end if end do call run("gfortran -c app/main.f90 -o main.o") +call package_name(pkg_name) src = exists("src/fpm.f90") if (src) then call run("gfortran main.o fpm.o -o fpm") |