diff options
author | Ondřej Čertík <ondrej@certik.us> | 2020-07-22 13:38:37 -0600 |
---|---|---|
committer | Ondřej Čertík <ondrej@certik.us> | 2020-07-22 15:29:58 -0600 |
commit | 6445315b1e473afefdfe79fef4adc304c2e69153 (patch) | |
tree | fcded60a49642bda7fe058122c2f06126d057b5e | |
parent | 2fee6474f00c4d589fc1f737519cd9965aa6b1ee (diff) | |
download | fpm-6445315b1e473afefdfe79fef4adc304c2e69153.tar.gz fpm-6445315b1e473afefdfe79fef4adc304c2e69153.zip |
Implement package_name()
-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") |